Add columnar test for json (#4553)

Co-authored-by: Jeff Davis <jefdavi@microsoft.com>
pull/4554/head
jeff-davis 2021-01-21 14:36:38 -08:00 committed by GitHub
parent 9b39b25390
commit 0581df23f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 0 deletions

View File

@ -66,3 +66,8 @@ CREATE TABLE test_null_values (a int, b int[], c composite_type)
COPY test_null_values FROM '@abs_srcdir@/data/null_values.csv' WITH CSV;
SELECT * FROM test_null_values;
CREATE TABLE test_json(j json) USING columnar;
INSERT INTO test_json SELECT ('{"att": ' || g::text || '}')::json from generate_series(1,1000000) g;
SELECT * FROM test_json WHERE (j->'att')::text::int8 > 999990;
DROP TABLE test_json;

View File

@ -76,3 +76,21 @@ SELECT * FROM test_null_values;
| |
(2 rows)
CREATE TABLE test_json(j json) USING columnar;
INSERT INTO test_json SELECT ('{"att": ' || g::text || '}')::json from generate_series(1,1000000) g;
SELECT * FROM test_json WHERE (j->'att')::text::int8 > 999990;
j
---------------------------------------------------------------------
{"att": 999991}
{"att": 999992}
{"att": 999993}
{"att": 999994}
{"att": 999995}
{"att": 999996}
{"att": 999997}
{"att": 999998}
{"att": 999999}
{"att": 1000000}
(10 rows)
DROP TABLE test_json;