diff options
author | Alexander Smirnov <alex@ydb.tech> | 2024-11-20 11:14:58 +0000 |
---|---|---|
committer | Alexander Smirnov <alex@ydb.tech> | 2024-11-20 11:14:58 +0000 |
commit | 31773f157bf8164364649b5f470f52dece0a4317 (patch) | |
tree | 33d0f7eef45303ab68cf08ab381ce5e5e36c5240 /yql/essentials/tests/postgresql/cases/arrays.err | |
parent | 2c7938962d8689e175574fc1e817c05049f27905 (diff) | |
parent | eff600952d5dfe17942f38f510a8ac2b203bb3a5 (diff) | |
download | ydb-31773f157bf8164364649b5f470f52dece0a4317.tar.gz |
Merge branch 'rightlib' into mergelibs-241120-1113
Diffstat (limited to 'yql/essentials/tests/postgresql/cases/arrays.err')
-rw-r--r-- | yql/essentials/tests/postgresql/cases/arrays.err | 3399 |
1 files changed, 3399 insertions, 0 deletions
diff --git a/yql/essentials/tests/postgresql/cases/arrays.err b/yql/essentials/tests/postgresql/cases/arrays.err new file mode 100644 index 0000000000..3ad6f30c2e --- /dev/null +++ b/yql/essentials/tests/postgresql/cases/arrays.err @@ -0,0 +1,3399 @@ +Registering pre-existing tables + tenk1 + int8_tbl +<sql-statement> +-- +-- ARRAYS +-- +CREATE TABLE arrtest ( + a int2[], + b int4[][][], + c name[], + d text[][], + e float8[], + f char(5)[], + g varchar(5)[] +); +</sql-statement> +<sql-statement> +-- +-- only the 'e' array is 0-based, the others are 1-based. +-- +INSERT INTO arrtest (a[1:5], b[1:1][1:2][1:2], c, d, f, g) + VALUES ('{1,2,3,4,5}', '{{{0,0},{1,2}}}', '{}', '{}', '{}', '{}'); +</sql-statement> +-stdin-:<main>: Fatal: Execution + + -stdin-:<main>:1:1: Fatal: Execution of node: YtFill! + -- + ^ + -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type smallint: "{1,2,3,4,5}" + + -- + ^ +<sql-statement> +UPDATE arrtest SET e[0] = '1.1'; +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +UPDATE arrtest SET e[1] = '2.2'; +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +INSERT INTO arrtest (f) + VALUES ('{"too long"}'); +</sql-statement> +<sql-statement> +INSERT INTO arrtest (a, b[1:2][1:2], c, d, e, f, g) + VALUES ('{11,12,23}', '{{3,4},{4,5}}', '{"foobar"}', + '{{"elt1", "elt2"}}', '{"3.4", "6.7"}', + '{"abc","abcde"}', '{"abc","abcde"}'); +</sql-statement> +-stdin-:<main>: Fatal: Execution + + -stdin-:<main>:1:1: Fatal: Execution of node: YtFill! + INSERT INTO arrtest (a, b[1:2][1:2], c, d, e, f, g) + ^ + -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type smallint: "{11,12,23}" + + INSERT INTO arrtest (a, b[1:2][1:2], c, d, e, f, g) + ^ +<sql-statement> +INSERT INTO arrtest (a, b[1:2], c, d[1:2]) + VALUES ('{}', '{3,4}', '{foo,bar}', '{bar,foo}'); +</sql-statement> +-stdin-:<main>: Fatal: Execution + + -stdin-:<main>:1:1: Fatal: Execution of node: YtFill! + INSERT INTO arrtest (a, b[1:2], c, d[1:2]) + ^ + -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type smallint: "{}" + + INSERT INTO arrtest (a, b[1:2], c, d[1:2]) + ^ +<sql-statement> +INSERT INTO arrtest (b[2]) VALUES(now()); -- error, type mismatch +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: YtWriteTable! + INSERT INTO arrtest (b[2]) VALUES(now()); -- error, type mismatch + ^ + -stdin-:<main>:1:1: Error: Failed to convert type: List<Struct<'b':pgtimestamptz>> to List<Struct<'a':pgint2,'b':pgint4,'c':pgname,'d':pgtext,'e':pgfloat8,'f':pgbpchar,'g':pgvarchar>> + INSERT INTO arrtest (b[2]) VALUES(now()); -- error, type mismatch + ^ + -stdin-:<main>:1:1: Error: Failed to convert 'b': pgtimestamptz to pgint4 + INSERT INTO arrtest (b[2]) VALUES(now()); -- error, type mismatch + ^ + -stdin-:<main>:1:1: Error: Table "arrtest" row type differs from the written row type: Struct<-a:pgint2,b:pgint4!=pgtimestamptz,-c:pgname,-d:pgtext,-e:pgfloat8,-f:pgbpchar,-g:pgvarchar> + INSERT INTO arrtest (b[2]) VALUES(now()); -- error, type mismatch + ^ +<sql-statement> +INSERT INTO arrtest (b[1:2]) VALUES(now()); -- error, type mismatch +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: YtWriteTable! + INSERT INTO arrtest (b[1:2]) VALUES(now()); -- error, type mismatch + ^ + -stdin-:<main>:1:1: Error: Failed to convert type: List<Struct<'b':pgtimestamptz>> to List<Struct<'a':pgint2,'b':pgint4,'c':pgname,'d':pgtext,'e':pgfloat8,'f':pgbpchar,'g':pgvarchar>> + INSERT INTO arrtest (b[1:2]) VALUES(now()); -- error, type mismatch + ^ + -stdin-:<main>:1:1: Error: Failed to convert 'b': pgtimestamptz to pgint4 + INSERT INTO arrtest (b[1:2]) VALUES(now()); -- error, type mismatch + ^ + -stdin-:<main>:1:1: Error: Table "arrtest" row type differs from the written row type: Struct<-a:pgint2,b:pgint4!=pgtimestamptz,-c:pgname,-d:pgtext,-e:pgfloat8,-f:pgbpchar,-g:pgvarchar> + INSERT INTO arrtest (b[1:2]) VALUES(now()); -- error, type mismatch + ^ +<sql-statement> +SELECT * FROM arrtest; +</sql-statement> +<sql-statement> +SELECT arrtest.a[1], + arrtest.b[1][1][1], + arrtest.c[1], + arrtest.d[1][1], + arrtest.e[0] + FROM arrtest; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360 + SELECT arrtest.a[1], + ^ +<sql-statement> +SELECT a[1], b[1][1][1], c[1], d[1][1], e[0] + FROM arrtest; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360 + SELECT a[1], b[1][1][1], c[1], d[1][1], e[0] + ^ +<sql-statement> +SELECT a[1:3], + b[1:1][1:2][1:2], + c[1:2], + d[1:1][1:2] + FROM arrtest; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360 + SELECT a[1:3], + ^ +<sql-statement> +SELECT array_ndims(a) AS a,array_ndims(b) AS b,array_ndims(c) AS c + FROM arrtest; +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem + SELECT array_ndims(a) AS a,array_ndims(b) AS b,array_ndims(c) AS c + ^ + -stdin-:<main>:1:1: Error: At function: PgResultItem + SELECT array_ndims(a) AS a,array_ndims(b) AS b,array_ndims(c) AS c + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + SELECT array_ndims(a) AS a,array_ndims(b) AS b,array_ndims(c) AS c + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_ndims with given argument types: (int2) + SELECT array_ndims(a) AS a,array_ndims(b) AS b,array_ndims(c) AS c + ^ + -stdin-:<main>:1:1: Error: At function: PgResultItem + SELECT array_ndims(a) AS a,array_ndims(b) AS b,array_ndims(c) AS c + ^ + -stdin-:<main>:1:28: Error: At function: PgCall + SELECT array_ndims(a) AS a,array_ndims(b) AS b,array_ndims(c) AS c + ^ + -stdin-:<main>:1:28: Error: Unable to find an overload for proc array_ndims with given argument types: (int4) + SELECT array_ndims(a) AS a,array_ndims(b) AS b,array_ndims(c) AS c + ^ + -stdin-:<main>:1:1: Error: At function: PgResultItem + SELECT array_ndims(a) AS a,array_ndims(b) AS b,array_ndims(c) AS c + ^ + -stdin-:<main>:1:48: Error: At function: PgCall + SELECT array_ndims(a) AS a,array_ndims(b) AS b,array_ndims(c) AS c + ^ + -stdin-:<main>:1:48: Error: Unable to find an overload for proc array_ndims with given argument types: (name) + SELECT array_ndims(a) AS a,array_ndims(b) AS b,array_ndims(c) AS c + ^ +<sql-statement> +SELECT array_dims(a) AS a,array_dims(b) AS b,array_dims(c) AS c + FROM arrtest; +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem + SELECT array_dims(a) AS a,array_dims(b) AS b,array_dims(c) AS c + ^ + -stdin-:<main>:1:1: Error: At function: PgResultItem + SELECT array_dims(a) AS a,array_dims(b) AS b,array_dims(c) AS c + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + SELECT array_dims(a) AS a,array_dims(b) AS b,array_dims(c) AS c + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_dims with given argument types: (int2) + SELECT array_dims(a) AS a,array_dims(b) AS b,array_dims(c) AS c + ^ + -stdin-:<main>:1:1: Error: At function: PgResultItem + SELECT array_dims(a) AS a,array_dims(b) AS b,array_dims(c) AS c + ^ + -stdin-:<main>:1:27: Error: At function: PgCall + SELECT array_dims(a) AS a,array_dims(b) AS b,array_dims(c) AS c + ^ + -stdin-:<main>:1:27: Error: Unable to find an overload for proc array_dims with given argument types: (int4) + SELECT array_dims(a) AS a,array_dims(b) AS b,array_dims(c) AS c + ^ + -stdin-:<main>:1:1: Error: At function: PgResultItem + SELECT array_dims(a) AS a,array_dims(b) AS b,array_dims(c) AS c + ^ + -stdin-:<main>:1:46: Error: At function: PgCall + SELECT array_dims(a) AS a,array_dims(b) AS b,array_dims(c) AS c + ^ + -stdin-:<main>:1:46: Error: Unable to find an overload for proc array_dims with given argument types: (name) + SELECT array_dims(a) AS a,array_dims(b) AS b,array_dims(c) AS c + ^ +<sql-statement> +-- returns nothing +SELECT * + FROM arrtest + WHERE a[1] < 5 and + c = '{"foobar"}'::_name; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:4:15: Error: alternative is not implemented yet : 360 + WHERE a[1] < 5 and + ^ +<sql-statement> +UPDATE arrtest + SET a[1:2] = '{16,25}' + WHERE NOT a = '{}'::_int2; +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +UPDATE arrtest + SET b[1:1][1:1][1:2] = '{113, 117}', + b[1:1][1:2][2:2] = '{142, 147}' + WHERE array_dims(b) = '[1:1][1:2][1:2]'; +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +UPDATE arrtest + SET c[2:2] = '{"new_word"}' + WHERE array_dims(c) is not null; +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +SELECT a,b,c FROM arrtest; +</sql-statement> +<sql-statement> +SELECT a[1:3], + b[1:1][1:2][1:2], + c[1:2], + d[1:1][2:2] + FROM arrtest; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360 + SELECT a[1:3], + ^ +<sql-statement> +SELECT b[1:1][2][2], + d[1:1][2] + FROM arrtest; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360 + SELECT b[1:1][2][2], + ^ +<sql-statement> +INSERT INTO arrtest(a) VALUES('{1,null,3}'); +</sql-statement> +-stdin-:<main>: Fatal: Execution + + -stdin-:<main>:1:1: Fatal: Execution of node: YtFill! + INSERT INTO arrtest(a) VALUES('{1,null,3}'); + ^ + -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type smallint: "{1,null,3}" + + INSERT INTO arrtest(a) VALUES('{1,null,3}'); + ^ +<sql-statement> +SELECT a FROM arrtest; +</sql-statement> +<sql-statement> +UPDATE arrtest SET a[4] = NULL WHERE a[2] IS NULL; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:43: Error: alternative is not implemented yet : 360 + UPDATE arrtest SET a[4] = NULL WHERE a[2] IS NULL; + ^ +<sql-statement> +SELECT a FROM arrtest WHERE a[2] IS NULL; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:34: Error: alternative is not implemented yet : 360 + SELECT a FROM arrtest WHERE a[2] IS NULL; + ^ +<sql-statement> +DELETE FROM arrtest WHERE a[2] IS NULL AND b IS NULL; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:32: Error: alternative is not implemented yet : 360 + DELETE FROM arrtest WHERE a[2] IS NULL AND b IS NULL; + ^ +<sql-statement> +SELECT a,b,c FROM arrtest; +</sql-statement> +<sql-statement> +-- test mixed slice/scalar subscripting +select '{{1,2,3},{4,5,6},{7,8,9}}'::int[]; +</sql-statement> +<sql-statement> +select ('{{1,2,3},{4,5,6},{7,8,9}}'::int[])[1:2][2]; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360 + select ('{{1,2,3},{4,5,6},{7,8,9}}'::int[])[1:2][2]; + ^ +<sql-statement> +select '[0:2][0:2]={{1,2,3},{4,5,6},{7,8,9}}'::int[]; +</sql-statement> +<sql-statement> +select ('[0:2][0:2]={{1,2,3},{4,5,6},{7,8,9}}'::int[])[1:2][2]; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360 + select ('[0:2][0:2]={{1,2,3},{4,5,6},{7,8,9}}'::int[])[1:2][2]; + ^ +<sql-statement> +-- +-- check subscription corner cases +-- +-- More subscripts than MAXDIM (6) +SELECT ('{}'::int[])[1][2][3][4][5][6][7]; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360 + -- + ^ +<sql-statement> +-- NULL index yields NULL when selecting +SELECT ('{{{1},{2},{3}},{{4},{5},{6}}}'::int[])[1][NULL][1]; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360 + -- NULL index yields NULL when selecting + ^ +<sql-statement> +SELECT ('{{{1},{2},{3}},{{4},{5},{6}}}'::int[])[1][NULL:1][1]; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360 + SELECT ('{{{1},{2},{3}},{{4},{5},{6}}}'::int[])[1][NULL:1][1]; + ^ +<sql-statement> +SELECT ('{{{1},{2},{3}},{{4},{5},{6}}}'::int[])[1][1:NULL][1]; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360 + SELECT ('{{{1},{2},{3}},{{4},{5},{6}}}'::int[])[1][1:NULL][1]; + ^ +<sql-statement> +-- NULL index in assignment is an error +UPDATE arrtest + SET c[NULL] = '{"can''t assign"}' + WHERE array_dims(c) is not null; +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +UPDATE arrtest + SET c[NULL:1] = '{"can''t assign"}' + WHERE array_dims(c) is not null; +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +UPDATE arrtest + SET c[1:NULL] = '{"can''t assign"}' + WHERE array_dims(c) is not null; +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +-- Un-subscriptable type +SELECT (now())[1]; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360 + -- Un-subscriptable type + ^ +<sql-statement> +-- test slices with empty lower and/or upper index +CREATE TEMP TABLE arrtest_s ( + a int2[], + b int2[][] +); +</sql-statement> +<sql-statement> +INSERT INTO arrtest_s VALUES ('{1,2,3,4,5}', '{{1,2,3}, {4,5,6}, {7,8,9}}'); +</sql-statement> +-stdin-:<main>: Fatal: Execution + + -stdin-:<main>:1:1: Fatal: Execution of node: YtFill! + INSERT INTO arrtest_s VALUES ('{1,2,3,4,5}', '{{1,2,3}, {4,5,6}, {7,8,9}}'); + ^ + -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type smallint: "{1,2,3,4,5}" + + INSERT INTO arrtest_s VALUES ('{1,2,3,4,5}', '{{1,2,3}, {4,5,6}, {7,8,9}}'); + ^ +<sql-statement> +INSERT INTO arrtest_s VALUES ('[0:4]={1,2,3,4,5}', '[0:2][0:2]={{1,2,3}, {4,5,6}, {7,8,9}}'); +</sql-statement> +-stdin-:<main>: Fatal: Execution + + -stdin-:<main>:1:1: Fatal: Execution of node: YtFill! + INSERT INTO arrtest_s VALUES ('[0:4]={1,2,3,4,5}', '[0:2][0:2]={{1,2,3}, {4,5,6}, {7,8,9}}'); + ^ + -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type smallint: "[0:4]={1,2,3,4,5}" + + INSERT INTO arrtest_s VALUES ('[0:4]={1,2,3,4,5}', '[0:2][0:2]={{1,2,3}, {4,5,6}, {7,8,9}}'); + ^ +<sql-statement> +SELECT * FROM arrtest_s; +</sql-statement> +<sql-statement> +SELECT a[:3], b[:2][:2] FROM arrtest_s; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360 + SELECT a[:3], b[:2][:2] FROM arrtest_s; + ^ +<sql-statement> +SELECT a[2:], b[2:][2:] FROM arrtest_s; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360 + SELECT a[2:], b[2:][2:] FROM arrtest_s; + ^ +<sql-statement> +SELECT a[:], b[:] FROM arrtest_s; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360 + SELECT a[:], b[:] FROM arrtest_s; + ^ +<sql-statement> +-- updates +UPDATE arrtest_s SET a[:3] = '{11, 12, 13}', b[:2][:2] = '{{11,12}, {14,15}}' + WHERE array_lower(a,1) = 1; +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +SELECT * FROM arrtest_s; +</sql-statement> +<sql-statement> +UPDATE arrtest_s SET a[3:] = '{23, 24, 25}', b[2:][2:] = '{{25,26}, {28,29}}'; +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +SELECT * FROM arrtest_s; +</sql-statement> +<sql-statement> +UPDATE arrtest_s SET a[:] = '{11, 12, 13, 14, 15}'; +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +SELECT * FROM arrtest_s; +</sql-statement> +<sql-statement> +UPDATE arrtest_s SET a[:] = '{23, 24, 25}'; -- fail, too small +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +INSERT INTO arrtest_s VALUES(NULL, NULL); +</sql-statement> +<sql-statement> +UPDATE arrtest_s SET a[:] = '{11, 12, 13, 14, 15}'; -- fail, no good with null +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +-- check with fixed-length-array type, such as point +SELECT f1[0:1] FROM POINT_TBL; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360 + -- check with fixed-length-array type, such as point + ^ +<sql-statement> +SELECT f1[0:] FROM POINT_TBL; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360 + SELECT f1[0:] FROM POINT_TBL; + ^ +<sql-statement> +SELECT f1[:1] FROM POINT_TBL; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360 + SELECT f1[:1] FROM POINT_TBL; + ^ +<sql-statement> +SELECT f1[:] FROM POINT_TBL; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360 + SELECT f1[:] FROM POINT_TBL; + ^ +<sql-statement> +-- subscript assignments to fixed-width result in NULL if previous value is NULL +UPDATE point_tbl SET f1[0] = 10 WHERE f1 IS NULL RETURNING *; +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +INSERT INTO point_tbl(f1[0]) VALUES(0) RETURNING *; +</sql-statement> +-stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'returning' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +-- NULL assignments get ignored +UPDATE point_tbl SET f1[0] = NULL WHERE f1::text = '(10,10)'::point::text RETURNING *; +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +-- but non-NULL subscript assignments work +UPDATE point_tbl SET f1[0] = -10, f1[1] = -10 WHERE f1::text = '(10,10)'::point::text RETURNING *; +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +-- but not to expand the range +UPDATE point_tbl SET f1[3] = 10 WHERE f1::text = '(-10,-10)'::point::text RETURNING *; +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +-- +-- test array extension +-- +CREATE TEMP TABLE arrtest1 (i int[], t text[]); +</sql-statement> +<sql-statement> +insert into arrtest1 values(array[1,2,null,4], array['one','two',null,'four']); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: YtWriteTable! + insert into arrtest1 values(array[1,2,null,4], array['one','two',null,'four']); + ^ + -stdin-:<main>:1:1: Error: Failed to convert type: List<Struct<'i':_pgint4,'t':_pgtext>> to List<Struct<'i':pgint4,'t':pgtext>> + insert into arrtest1 values(array[1,2,null,4], array['one','two',null,'four']); + ^ + -stdin-:<main>:1:1: Error: Failed to convert 'i': _pgint4 to pgint4 + insert into arrtest1 values(array[1,2,null,4], array['one','two',null,'four']); + ^ + -stdin-:<main>:1:1: Error: Table "arrtest1" row type differs from the written row type: Struct<i:pgint4!=_pgint4,t:pgtext!=_pgtext> + insert into arrtest1 values(array[1,2,null,4], array['one','two',null,'four']); + ^ +<sql-statement> +select * from arrtest1; +</sql-statement> +<sql-statement> +update arrtest1 set i[2] = 22, t[2] = 'twenty-two'; +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +select * from arrtest1; +</sql-statement> +<sql-statement> +update arrtest1 set i[5] = 5, t[5] = 'five'; +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +select * from arrtest1; +</sql-statement> +<sql-statement> +update arrtest1 set i[8] = 8, t[8] = 'eight'; +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +select * from arrtest1; +</sql-statement> +<sql-statement> +update arrtest1 set i[0] = 0, t[0] = 'zero'; +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +select * from arrtest1; +</sql-statement> +<sql-statement> +update arrtest1 set i[-3] = -3, t[-3] = 'minus-three'; +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +select * from arrtest1; +</sql-statement> +<sql-statement> +update arrtest1 set i[0:2] = array[10,11,12], t[0:2] = array['ten','eleven','twelve']; +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +select * from arrtest1; +</sql-statement> +<sql-statement> +update arrtest1 set i[8:10] = array[18,null,20], t[8:10] = array['p18',null,'p20']; +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +select * from arrtest1; +</sql-statement> +<sql-statement> +update arrtest1 set i[11:12] = array[null,22], t[11:12] = array[null,'p22']; +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +select * from arrtest1; +</sql-statement> +<sql-statement> +update arrtest1 set i[15:16] = array[null,26], t[15:16] = array[null,'p26']; +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +select * from arrtest1; +</sql-statement> +<sql-statement> +update arrtest1 set i[-5:-3] = array[-15,-14,-13], t[-5:-3] = array['m15','m14','m13']; +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +select * from arrtest1; +</sql-statement> +<sql-statement> +update arrtest1 set i[-7:-6] = array[-17,null], t[-7:-6] = array['m17',null]; +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +select * from arrtest1; +</sql-statement> +<sql-statement> +update arrtest1 set i[-12:-10] = array[-22,null,-20], t[-12:-10] = array['m22',null,'m20']; +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +select * from arrtest1; +</sql-statement> +<sql-statement> +delete from arrtest1; +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_delete' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +insert into arrtest1 values(array[1,2,null,4], array['one','two',null,'four']); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: YtWriteTable! + insert into arrtest1 values(array[1,2,null,4], array['one','two',null,'four']); + ^ + -stdin-:<main>:1:1: Error: Failed to convert type: List<Struct<'i':_pgint4,'t':_pgtext>> to List<Struct<'i':pgint4,'t':pgtext>> + insert into arrtest1 values(array[1,2,null,4], array['one','two',null,'four']); + ^ + -stdin-:<main>:1:1: Error: Failed to convert 'i': _pgint4 to pgint4 + insert into arrtest1 values(array[1,2,null,4], array['one','two',null,'four']); + ^ + -stdin-:<main>:1:1: Error: Table "arrtest1" row type differs from the written row type: Struct<i:pgint4!=_pgint4,t:pgtext!=_pgtext> + insert into arrtest1 values(array[1,2,null,4], array['one','two',null,'four']); + ^ +<sql-statement> +select * from arrtest1; +</sql-statement> +<sql-statement> +update arrtest1 set i[0:5] = array[0,1,2,null,4,5], t[0:5] = array['z','p1','p2',null,'p4','p5']; +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +select * from arrtest1; +</sql-statement> +<sql-statement> +-- +-- array expressions and operators +-- +-- table creation and INSERTs +CREATE TEMP TABLE arrtest2 (i integer ARRAY[4], f float8[], n numeric[], t text[], d timestamp[]); +</sql-statement> +<sql-statement> +INSERT INTO arrtest2 VALUES( + ARRAY[[[113,142],[1,147]]], + ARRAY[1.1,1.2,1.3]::float8[], + ARRAY[1.1,1.2,1.3], + ARRAY[[['aaa','aab'],['aba','abb'],['aca','acb']],[['baa','bab'],['bba','bbb'],['bca','bcb']]], + ARRAY['19620326','19931223','19970117']::timestamp[] +); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: YtWriteTable! + INSERT INTO arrtest2 VALUES( + ^ + -stdin-:<main>:1:1: Error: Failed to convert type: List<Struct<'d':_pgtimestamp,'f':_pgfloat8,'i':_pgint4,'n':_pgnumeric,'t':_pgtext>> to List<Struct<'d':pgtimestamp,'f':pgfloat8,'i':pgint4,'n':pgnumeric,'t':pgtext>> + INSERT INTO arrtest2 VALUES( + ^ + -stdin-:<main>:1:1: Error: Failed to convert 'd': _pgtimestamp to pgtimestamp + INSERT INTO arrtest2 VALUES( + ^ + -stdin-:<main>:1:1: Error: Table "arrtest2" row type differs from the written row type: Struct<d:pgtimestamp!=_pgtimestamp,f:pgfloat8!=_pgfloat8,i:pgint4!=_pgint4,n:pgnumeric!=_pgnumeric,t:pgtext!=_pgtext> + INSERT INTO arrtest2 VALUES( + ^ +<sql-statement> +-- some more test data +CREATE TEMP TABLE arrtest_f (f0 int, f1 text, f2 float8); +</sql-statement> +<sql-statement> +insert into arrtest_f values(1,'cat1',1.21); +</sql-statement> +<sql-statement> +insert into arrtest_f values(2,'cat1',1.24); +</sql-statement> +<sql-statement> +insert into arrtest_f values(3,'cat1',1.18); +</sql-statement> +<sql-statement> +insert into arrtest_f values(4,'cat1',1.26); +</sql-statement> +<sql-statement> +insert into arrtest_f values(5,'cat1',1.15); +</sql-statement> +<sql-statement> +insert into arrtest_f values(6,'cat2',1.15); +</sql-statement> +<sql-statement> +insert into arrtest_f values(7,'cat2',1.26); +</sql-statement> +<sql-statement> +insert into arrtest_f values(8,'cat2',1.32); +</sql-statement> +<sql-statement> +insert into arrtest_f values(9,'cat2',1.30); +</sql-statement> +<sql-statement> +CREATE TEMP TABLE arrtest_i (f0 int, f1 text, f2 int); +</sql-statement> +<sql-statement> +insert into arrtest_i values(1,'cat1',21); +</sql-statement> +<sql-statement> +insert into arrtest_i values(2,'cat1',24); +</sql-statement> +<sql-statement> +insert into arrtest_i values(3,'cat1',18); +</sql-statement> +<sql-statement> +insert into arrtest_i values(4,'cat1',26); +</sql-statement> +<sql-statement> +insert into arrtest_i values(5,'cat1',15); +</sql-statement> +<sql-statement> +insert into arrtest_i values(6,'cat2',15); +</sql-statement> +<sql-statement> +insert into arrtest_i values(7,'cat2',26); +</sql-statement> +<sql-statement> +insert into arrtest_i values(8,'cat2',32); +</sql-statement> +<sql-statement> +insert into arrtest_i values(9,'cat2',30); +</sql-statement> +<sql-statement> +-- expressions +SELECT t.f[1][3][1] AS "131", t.f[2][2][1] AS "221" FROM ( + SELECT ARRAY[[[111,112],[121,122],[131,132]],[[211,212],[221,122],[231,232]]] AS f +) AS t; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360 + -- expressions + ^ +<sql-statement> +SELECT ARRAY[[[[[['hello'],['world']]]]]]; +</sql-statement> +<sql-statement> +SELECT ARRAY[ARRAY['hello'],ARRAY['world']]; +</sql-statement> +<sql-statement> +SELECT ARRAY(select f2 from arrtest_f order by f2) AS "ARRAY"; +</sql-statement> +<sql-statement> +-- with nulls +SELECT '{1,null,3}'::int[]; +</sql-statement> +<sql-statement> +SELECT ARRAY[1,NULL,3]; +</sql-statement> +<sql-statement> +-- functions +SELECT array_append(array[42], 6) AS "{42,6}"; +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + -- functions + ^ + -stdin-:<main>:2:8: Error: At function: PgCall + SELECT array_append(array[42], 6) AS "{42,6}"; + ^ + -stdin-:<main>:2:8: Error: Unable to find an overload for proc array_append with given argument types: (_int4,int4) + SELECT array_append(array[42], 6) AS "{42,6}"; + ^ +<sql-statement> +SELECT array_prepend(6, array[42]) AS "{6,42}"; +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT array_prepend(6, array[42]) AS "{6,42}"; + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + SELECT array_prepend(6, array[42]) AS "{6,42}"; + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_prepend with given argument types: (int4,_int4) + SELECT array_prepend(6, array[42]) AS "{6,42}"; + ^ +<sql-statement> +SELECT array_cat(ARRAY[1,2], ARRAY[3,4]) AS "{1,2,3,4}"; +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT array_cat(ARRAY[1,2], ARRAY[3,4]) AS "{1,2,3,4}"; + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + SELECT array_cat(ARRAY[1,2], ARRAY[3,4]) AS "{1,2,3,4}"; + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_cat with given argument types: (_int4,_int4) + SELECT array_cat(ARRAY[1,2], ARRAY[3,4]) AS "{1,2,3,4}"; + ^ +<sql-statement> +SELECT array_cat(ARRAY[1,2], ARRAY[[3,4],[5,6]]) AS "{{1,2},{3,4},{5,6}}"; +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT array_cat(ARRAY[1,2], ARRAY[[3,4],[5,6]]) AS "{{1,2},{3,4},{5,6}}"; + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + SELECT array_cat(ARRAY[1,2], ARRAY[[3,4],[5,6]]) AS "{{1,2},{3,4},{5,6}}"; + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_cat with given argument types: (_int4,_int4) + SELECT array_cat(ARRAY[1,2], ARRAY[[3,4],[5,6]]) AS "{{1,2},{3,4},{5,6}}"; + ^ +<sql-statement> +SELECT array_cat(ARRAY[[3,4],[5,6]], ARRAY[1,2]) AS "{{3,4},{5,6},{1,2}}"; +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT array_cat(ARRAY[[3,4],[5,6]], ARRAY[1,2]) AS "{{3,4},{5,6},{1,2}}"; + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + SELECT array_cat(ARRAY[[3,4],[5,6]], ARRAY[1,2]) AS "{{3,4},{5,6},{1,2}}"; + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_cat with given argument types: (_int4,_int4) + SELECT array_cat(ARRAY[[3,4],[5,6]], ARRAY[1,2]) AS "{{3,4},{5,6},{1,2}}"; + ^ +<sql-statement> +SELECT array_position(ARRAY[1,2,3,4,5], 4); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT array_position(ARRAY[1,2,3,4,5], 4); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + SELECT array_position(ARRAY[1,2,3,4,5], 4); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_position with given argument types: (_int4,int4) + SELECT array_position(ARRAY[1,2,3,4,5], 4); + ^ +<sql-statement> +SELECT array_position(ARRAY[5,3,4,2,1], 4); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT array_position(ARRAY[5,3,4,2,1], 4); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + SELECT array_position(ARRAY[5,3,4,2,1], 4); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_position with given argument types: (_int4,int4) + SELECT array_position(ARRAY[5,3,4,2,1], 4); + ^ +<sql-statement> +SELECT array_position(ARRAY[[1,2],[3,4]], 3); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT array_position(ARRAY[[1,2],[3,4]], 3); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + SELECT array_position(ARRAY[[1,2],[3,4]], 3); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_position with given argument types: (_int4,int4) + SELECT array_position(ARRAY[[1,2],[3,4]], 3); + ^ +<sql-statement> +SELECT array_position(ARRAY['sun','mon','tue','wed','thu','fri','sat'], 'mon'); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT array_position(ARRAY['sun','mon','tue','wed','thu','fri','sat'], 'mon'); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + SELECT array_position(ARRAY['sun','mon','tue','wed','thu','fri','sat'], 'mon'); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_position with given argument types: (_text,unknown) + SELECT array_position(ARRAY['sun','mon','tue','wed','thu','fri','sat'], 'mon'); + ^ +<sql-statement> +SELECT array_position(ARRAY['sun','mon','tue','wed','thu','fri','sat'], 'sat'); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT array_position(ARRAY['sun','mon','tue','wed','thu','fri','sat'], 'sat'); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + SELECT array_position(ARRAY['sun','mon','tue','wed','thu','fri','sat'], 'sat'); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_position with given argument types: (_text,unknown) + SELECT array_position(ARRAY['sun','mon','tue','wed','thu','fri','sat'], 'sat'); + ^ +<sql-statement> +SELECT array_position(ARRAY['sun','mon','tue','wed','thu','fri','sat'], NULL); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT array_position(ARRAY['sun','mon','tue','wed','thu','fri','sat'], NULL); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + SELECT array_position(ARRAY['sun','mon','tue','wed','thu','fri','sat'], NULL); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_position with given argument types: (_text,unknown) + SELECT array_position(ARRAY['sun','mon','tue','wed','thu','fri','sat'], NULL); + ^ +<sql-statement> +SELECT array_position(ARRAY['sun','mon','tue','wed','thu',NULL,'fri','sat'], NULL); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT array_position(ARRAY['sun','mon','tue','wed','thu',NULL,'fri','sat'], NULL); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + SELECT array_position(ARRAY['sun','mon','tue','wed','thu',NULL,'fri','sat'], NULL); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_position with given argument types: (_text,unknown) + SELECT array_position(ARRAY['sun','mon','tue','wed','thu',NULL,'fri','sat'], NULL); + ^ +<sql-statement> +SELECT array_position(ARRAY['sun','mon','tue','wed','thu',NULL,'fri','sat'], 'sat'); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT array_position(ARRAY['sun','mon','tue','wed','thu',NULL,'fri','sat'], 'sat'); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + SELECT array_position(ARRAY['sun','mon','tue','wed','thu',NULL,'fri','sat'], 'sat'); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_position with given argument types: (_text,unknown) + SELECT array_position(ARRAY['sun','mon','tue','wed','thu',NULL,'fri','sat'], 'sat'); + ^ +<sql-statement> +SELECT array_positions(NULL, 10); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT array_positions(NULL, 10); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + SELECT array_positions(NULL, 10); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_positions with given argument types: (unknown,int4) + SELECT array_positions(NULL, 10); + ^ +<sql-statement> +SELECT array_positions(NULL, NULL::int); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT array_positions(NULL, NULL::int); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + SELECT array_positions(NULL, NULL::int); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_positions with given argument types: (unknown,int4) + SELECT array_positions(NULL, NULL::int); + ^ +<sql-statement> +SELECT array_positions(ARRAY[1,2,3,4,5,6,1,2,3,4,5,6], 4); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT array_positions(ARRAY[1,2,3,4,5,6,1,2,3,4,5,6], 4); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + SELECT array_positions(ARRAY[1,2,3,4,5,6,1,2,3,4,5,6], 4); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_positions with given argument types: (_int4,int4) + SELECT array_positions(ARRAY[1,2,3,4,5,6,1,2,3,4,5,6], 4); + ^ +<sql-statement> +SELECT array_positions(ARRAY[[1,2],[3,4]], 4); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT array_positions(ARRAY[[1,2],[3,4]], 4); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + SELECT array_positions(ARRAY[[1,2],[3,4]], 4); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_positions with given argument types: (_int4,int4) + SELECT array_positions(ARRAY[[1,2],[3,4]], 4); + ^ +<sql-statement> +SELECT array_positions(ARRAY[1,2,3,4,5,6,1,2,3,4,5,6], NULL); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT array_positions(ARRAY[1,2,3,4,5,6,1,2,3,4,5,6], NULL); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + SELECT array_positions(ARRAY[1,2,3,4,5,6,1,2,3,4,5,6], NULL); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_positions with given argument types: (_int4,unknown) + SELECT array_positions(ARRAY[1,2,3,4,5,6,1,2,3,4,5,6], NULL); + ^ +<sql-statement> +SELECT array_positions(ARRAY[1,2,3,NULL,5,6,1,2,3,NULL,5,6], NULL); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT array_positions(ARRAY[1,2,3,NULL,5,6,1,2,3,NULL,5,6], NULL); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + SELECT array_positions(ARRAY[1,2,3,NULL,5,6,1,2,3,NULL,5,6], NULL); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_positions with given argument types: (_int4,unknown) + SELECT array_positions(ARRAY[1,2,3,NULL,5,6,1,2,3,NULL,5,6], NULL); + ^ +<sql-statement> +SELECT array_length(array_positions(ARRAY(SELECT 'AAAAAAAAAAAAAAAAAAAAAAAAA'::text || i % 10 + FROM generate_series(1,100) g(i)), + 'AAAAAAAAAAAAAAAAAAAAAAAAA5'), 1); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT array_length(array_positions(ARRAY(SELECT 'AAAAAAAAAAAAAAAAAAAAAAAAA'::text || i % 10 + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + SELECT array_length(array_positions(ARRAY(SELECT 'AAAAAAAAAAAAAAAAAAAAAAAAA'::text || i % 10 + ^ + -stdin-:<main>:1:21: Error: At function: PgCall + SELECT array_length(array_positions(ARRAY(SELECT 'AAAAAAAAAAAAAAAAAAAAAAAAA'::text || i % 10 + ^ + -stdin-:<main>:1:37: Error: At function: PgSubLink, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT array_length(array_positions(ARRAY(SELECT 'AAAAAAAAAAAAAAAAAAAAAAAAA'::text || i % 10 + ^ + -stdin-:<main>:1:84: Error: At function: PgOp + SELECT array_length(array_positions(ARRAY(SELECT 'AAAAAAAAAAAAAAAAAAAAAAAAA'::text || i % 10 + ^ + -stdin-:<main>:1:84: Error: Unable to find an overload for operator || with given argument type(s): (text,int4) + SELECT array_length(array_positions(ARRAY(SELECT 'AAAAAAAAAAAAAAAAAAAAAAAAA'::text || i % 10 + ^ +<sql-statement> +DO $$ +DECLARE + o int; + a int[] := ARRAY[1,2,3,2,3,1,2]; +BEGIN + o := array_position(a, 2); + WHILE o IS NOT NULL + LOOP + RAISE NOTICE '%', o; + o := array_position(a, 2, o + 1); + END LOOP; +END +$$ LANGUAGE plpgsql; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 263 + DO $$ + ^ +<sql-statement> +SELECT array_position('[2:4]={1,2,3}'::int[], 1); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT array_position('[2:4]={1,2,3}'::int[], 1); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + SELECT array_position('[2:4]={1,2,3}'::int[], 1); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_position with given argument types: (_int4,int4) + SELECT array_position('[2:4]={1,2,3}'::int[], 1); + ^ +<sql-statement> +SELECT array_positions('[2:4]={1,2,3}'::int[], 1); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT array_positions('[2:4]={1,2,3}'::int[], 1); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + SELECT array_positions('[2:4]={1,2,3}'::int[], 1); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_positions with given argument types: (_int4,int4) + SELECT array_positions('[2:4]={1,2,3}'::int[], 1); + ^ +<sql-statement> +SELECT + array_position(ids, (1, 1)), + array_positions(ids, (1, 1)) + FROM +(VALUES + (ARRAY[(0, 0), (1, 1)]), + (ARRAY[(1, 1)]) +) AS f (ids); +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:6:6: Error: alternative is not implemented yet : 138 + (ARRAY[(0, 0), (1, 1)]), + ^ + -stdin-:<main>:2:5: Error: alternative is not implemented yet : 138 + array_position(ids, (1, 1)), + ^ +<sql-statement> +-- operators +SELECT a FROM arrtest WHERE b = ARRAY[[[113,142],[1,147]]]; +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect + -- operators + ^ + -stdin-:<main>: Error: At function: PgSetItem + + -stdin-:<main>:1:1: Error: At function: PgWhere + -- operators + ^ + -stdin-:<main>:2:31: Error: At function: PgOp + SELECT a FROM arrtest WHERE b = ARRAY[[[113,142],[1,147]]]; + ^ + -stdin-:<main>:2:31: Error: Unable to find an overload for operator = with given argument type(s): (int4,_int4) + SELECT a FROM arrtest WHERE b = ARRAY[[[113,142],[1,147]]]; + ^ +<sql-statement> +SELECT NOT ARRAY[1.1,1.2,1.3] = ARRAY[1.1,1.2,1.3] AS "FALSE"; +</sql-statement> +<sql-statement> +SELECT ARRAY[1,2] || 3 AS "{1,2,3}"; +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT ARRAY[1,2] || 3 AS "{1,2,3}"; + ^ + -stdin-:<main>:1:19: Error: At function: PgOp + SELECT ARRAY[1,2] || 3 AS "{1,2,3}"; + ^ + -stdin-:<main>:1:19: Error: Unable to find an overload for operator || with given argument type(s): (_int4,int4) + SELECT ARRAY[1,2] || 3 AS "{1,2,3}"; + ^ +<sql-statement> +SELECT 0 || ARRAY[1,2] AS "{0,1,2}"; +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT 0 || ARRAY[1,2] AS "{0,1,2}"; + ^ + -stdin-:<main>:1:10: Error: At function: PgOp + SELECT 0 || ARRAY[1,2] AS "{0,1,2}"; + ^ + -stdin-:<main>:1:10: Error: Unable to find an overload for operator || with given argument type(s): (int4,_int4) + SELECT 0 || ARRAY[1,2] AS "{0,1,2}"; + ^ +<sql-statement> +SELECT ARRAY[1,2] || ARRAY[3,4] AS "{1,2,3,4}"; +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT ARRAY[1,2] || ARRAY[3,4] AS "{1,2,3,4}"; + ^ + -stdin-:<main>:1:19: Error: At function: PgOp + SELECT ARRAY[1,2] || ARRAY[3,4] AS "{1,2,3,4}"; + ^ + -stdin-:<main>:1:19: Error: Unable to find an overload for operator || with given argument type(s): (_int4,_int4) + SELECT ARRAY[1,2] || ARRAY[3,4] AS "{1,2,3,4}"; + ^ +<sql-statement> +SELECT ARRAY[[['hello','world']]] || ARRAY[[['happy','birthday']]] AS "ARRAY"; +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT ARRAY[[['hello','world']]] || ARRAY[[['happy','birthday']]] AS "ARRAY"; + ^ + -stdin-:<main>:1:35: Error: At function: PgOp + SELECT ARRAY[[['hello','world']]] || ARRAY[[['happy','birthday']]] AS "ARRAY"; + ^ + -stdin-:<main>:1:35: Error: Unable to find an overload for operator || with given argument type(s): (_text,_text) + SELECT ARRAY[[['hello','world']]] || ARRAY[[['happy','birthday']]] AS "ARRAY"; + ^ +<sql-statement> +SELECT ARRAY[[1,2],[3,4]] || ARRAY[5,6] AS "{{1,2},{3,4},{5,6}}"; +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT ARRAY[[1,2],[3,4]] || ARRAY[5,6] AS "{{1,2},{3,4},{5,6}}"; + ^ + -stdin-:<main>:1:27: Error: At function: PgOp + SELECT ARRAY[[1,2],[3,4]] || ARRAY[5,6] AS "{{1,2},{3,4},{5,6}}"; + ^ + -stdin-:<main>:1:27: Error: Unable to find an overload for operator || with given argument type(s): (_int4,_int4) + SELECT ARRAY[[1,2],[3,4]] || ARRAY[5,6] AS "{{1,2},{3,4},{5,6}}"; + ^ +<sql-statement> +SELECT ARRAY[0,0] || ARRAY[1,1] || ARRAY[2,2] AS "{0,0,1,1,2,2}"; +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT ARRAY[0,0] || ARRAY[1,1] || ARRAY[2,2] AS "{0,0,1,1,2,2}"; + ^ + -stdin-:<main>:1:33: Error: At function: PgOp + SELECT ARRAY[0,0] || ARRAY[1,1] || ARRAY[2,2] AS "{0,0,1,1,2,2}"; + ^ + -stdin-:<main>:1:19: Error: At function: PgOp + SELECT ARRAY[0,0] || ARRAY[1,1] || ARRAY[2,2] AS "{0,0,1,1,2,2}"; + ^ + -stdin-:<main>:1:19: Error: Unable to find an overload for operator || with given argument type(s): (_int4,_int4) + SELECT ARRAY[0,0] || ARRAY[1,1] || ARRAY[2,2] AS "{0,0,1,1,2,2}"; + ^ +<sql-statement> +SELECT 0 || ARRAY[1,2] || 3 AS "{0,1,2,3}"; +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT 0 || ARRAY[1,2] || 3 AS "{0,1,2,3}"; + ^ + -stdin-:<main>:1:24: Error: At function: PgOp + SELECT 0 || ARRAY[1,2] || 3 AS "{0,1,2,3}"; + ^ + -stdin-:<main>:1:10: Error: At function: PgOp + SELECT 0 || ARRAY[1,2] || 3 AS "{0,1,2,3}"; + ^ + -stdin-:<main>:1:10: Error: Unable to find an overload for operator || with given argument type(s): (int4,_int4) + SELECT 0 || ARRAY[1,2] || 3 AS "{0,1,2,3}"; + ^ +<sql-statement> +SELECT ARRAY[1.1] || ARRAY[2,3,4]; +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT ARRAY[1.1] || ARRAY[2,3,4]; + ^ + -stdin-:<main>:1:19: Error: At function: PgOp + SELECT ARRAY[1.1] || ARRAY[2,3,4]; + ^ + -stdin-:<main>:1:19: Error: Unable to find an overload for operator || with given argument type(s): (_numeric,_int4) + SELECT ARRAY[1.1] || ARRAY[2,3,4]; + ^ +<sql-statement> +SELECT array_agg(x) || array_agg(x) FROM (VALUES (ROW(1,2)), (ROW(3,4))) v(x); +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: alternative is not implemented yet : 138 + SELECT array_agg(x) || array_agg(x) FROM (VALUES (ROW(1,2)), (ROW(3,4))) v(x); + ^ +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect + SELECT array_agg(x) || array_agg(x) FROM (VALUES (ROW(1,2)), (ROW(3,4))) v(x); + ^ + -stdin-:<main>:1:1: Error: Recursive query does not have the form non-recursive-term UNION [ALL] recursive-term + SELECT array_agg(x) || array_agg(x) FROM (VALUES (ROW(1,2)), (ROW(3,4))) v(x); + ^ +<sql-statement> +SELECT ROW(1,2) || array_agg(x) FROM (VALUES (ROW(3,4)), (ROW(5,6))) v(x); +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: alternative is not implemented yet : 138 + SELECT ROW(1,2) || array_agg(x) FROM (VALUES (ROW(3,4)), (ROW(5,6))) v(x); + ^ + -stdin-:<main>:1:17: Error: alternative is not implemented yet : 138 + SELECT ROW(1,2) || array_agg(x) FROM (VALUES (ROW(3,4)), (ROW(5,6))) v(x); + ^ +<sql-statement> +SELECT * FROM array_op_test WHERE i @> '{32}' ORDER BY seqno; +</sql-statement> +-stdin-:<main>: Fatal: Table metadata loading + + -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.array_op_test + +<sql-statement> +SELECT * FROM array_op_test WHERE i && '{32}' ORDER BY seqno; +</sql-statement> +-stdin-:<main>: Fatal: Table metadata loading + + -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.array_op_test + +<sql-statement> +SELECT * FROM array_op_test WHERE i @> '{17}' ORDER BY seqno; +</sql-statement> +-stdin-:<main>: Fatal: Table metadata loading + + -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.array_op_test + +<sql-statement> +SELECT * FROM array_op_test WHERE i && '{17}' ORDER BY seqno; +</sql-statement> +-stdin-:<main>: Fatal: Table metadata loading + + -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.array_op_test + +<sql-statement> +SELECT * FROM array_op_test WHERE i @> '{32,17}' ORDER BY seqno; +</sql-statement> +-stdin-:<main>: Fatal: Table metadata loading + + -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.array_op_test + +<sql-statement> +SELECT * FROM array_op_test WHERE i && '{32,17}' ORDER BY seqno; +</sql-statement> +-stdin-:<main>: Fatal: Table metadata loading + + -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.array_op_test + +<sql-statement> +SELECT * FROM array_op_test WHERE i <@ '{38,34,32,89}' ORDER BY seqno; +</sql-statement> +-stdin-:<main>: Fatal: Table metadata loading + + -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.array_op_test + +<sql-statement> +SELECT * FROM array_op_test WHERE i = '{}' ORDER BY seqno; +</sql-statement> +-stdin-:<main>: Fatal: Table metadata loading + + -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.array_op_test + +<sql-statement> +SELECT * FROM array_op_test WHERE i @> '{}' ORDER BY seqno; +</sql-statement> +-stdin-:<main>: Fatal: Table metadata loading + + -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.array_op_test + +<sql-statement> +SELECT * FROM array_op_test WHERE i && '{}' ORDER BY seqno; +</sql-statement> +-stdin-:<main>: Fatal: Table metadata loading + + -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.array_op_test + +<sql-statement> +SELECT * FROM array_op_test WHERE i <@ '{}' ORDER BY seqno; +</sql-statement> +-stdin-:<main>: Fatal: Table metadata loading + + -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.array_op_test + +<sql-statement> +SELECT * FROM array_op_test WHERE i = '{NULL}' ORDER BY seqno; +</sql-statement> +-stdin-:<main>: Fatal: Table metadata loading + + -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.array_op_test + +<sql-statement> +SELECT * FROM array_op_test WHERE i @> '{NULL}' ORDER BY seqno; +</sql-statement> +-stdin-:<main>: Fatal: Table metadata loading + + -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.array_op_test + +<sql-statement> +SELECT * FROM array_op_test WHERE i && '{NULL}' ORDER BY seqno; +</sql-statement> +-stdin-:<main>: Fatal: Table metadata loading + + -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.array_op_test + +<sql-statement> +SELECT * FROM array_op_test WHERE i <@ '{NULL}' ORDER BY seqno; +</sql-statement> +-stdin-:<main>: Fatal: Table metadata loading + + -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.array_op_test + +<sql-statement> +SELECT * FROM array_op_test WHERE t @> '{AAAAAAAA72908}' ORDER BY seqno; +</sql-statement> +-stdin-:<main>: Fatal: Table metadata loading + + -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.array_op_test + +<sql-statement> +SELECT * FROM array_op_test WHERE t && '{AAAAAAAA72908}' ORDER BY seqno; +</sql-statement> +-stdin-:<main>: Fatal: Table metadata loading + + -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.array_op_test + +<sql-statement> +SELECT * FROM array_op_test WHERE t @> '{AAAAAAAAAA646}' ORDER BY seqno; +</sql-statement> +-stdin-:<main>: Fatal: Table metadata loading + + -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.array_op_test + +<sql-statement> +SELECT * FROM array_op_test WHERE t && '{AAAAAAAAAA646}' ORDER BY seqno; +</sql-statement> +-stdin-:<main>: Fatal: Table metadata loading + + -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.array_op_test + +<sql-statement> +SELECT * FROM array_op_test WHERE t @> '{AAAAAAAA72908,AAAAAAAAAA646}' ORDER BY seqno; +</sql-statement> +-stdin-:<main>: Fatal: Table metadata loading + + -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.array_op_test + +<sql-statement> +SELECT * FROM array_op_test WHERE t && '{AAAAAAAA72908,AAAAAAAAAA646}' ORDER BY seqno; +</sql-statement> +-stdin-:<main>: Fatal: Table metadata loading + + -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.array_op_test + +<sql-statement> +SELECT * FROM array_op_test WHERE t <@ '{AAAAAAAA72908,AAAAAAAAAAAAAAAAAAA17075,AA88409,AAAAAAAAAAAAAAAAAA36842,AAAAAAA48038,AAAAAAAAAAAAAA10611}' ORDER BY seqno; +</sql-statement> +-stdin-:<main>: Fatal: Table metadata loading + + -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.array_op_test + +<sql-statement> +SELECT * FROM array_op_test WHERE t = '{}' ORDER BY seqno; +</sql-statement> +-stdin-:<main>: Fatal: Table metadata loading + + -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.array_op_test + +<sql-statement> +SELECT * FROM array_op_test WHERE t @> '{}' ORDER BY seqno; +</sql-statement> +-stdin-:<main>: Fatal: Table metadata loading + + -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.array_op_test + +<sql-statement> +SELECT * FROM array_op_test WHERE t && '{}' ORDER BY seqno; +</sql-statement> +-stdin-:<main>: Fatal: Table metadata loading + + -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.array_op_test + +<sql-statement> +SELECT * FROM array_op_test WHERE t <@ '{}' ORDER BY seqno; +</sql-statement> +-stdin-:<main>: Fatal: Table metadata loading + + -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.array_op_test + +<sql-statement> +-- array casts +SELECT ARRAY[1,2,3]::text[]::int[]::float8[] AS "{1,2,3}"; +</sql-statement> +<sql-statement> +SELECT pg_typeof(ARRAY[1,2,3]::text[]::int[]::float8[]) AS "double precision[]"; +</sql-statement> +<sql-statement> +SELECT ARRAY[['a','bc'],['def','hijk']]::text[]::varchar[] AS "{{a,bc},{def,hijk}}"; +</sql-statement> +<sql-statement> +SELECT pg_typeof(ARRAY[['a','bc'],['def','hijk']]::text[]::varchar[]) AS "character varying[]"; +</sql-statement> +<sql-statement> +SELECT CAST(ARRAY[[[[[['a','bb','ccc']]]]]] as text[]) as "{{{{{{a,bb,ccc}}}}}}"; +</sql-statement> +<sql-statement> +SELECT NULL::text[]::int[] AS "NULL"; +</sql-statement> +<sql-statement> +-- scalar op any/all (array) +select 33 = any ('{1,2,3}'); +</sql-statement> +<sql-statement> +select 33 = any ('{1,2,33}'); +</sql-statement> +<sql-statement> +select 33 = all ('{1,2,33}'); +</sql-statement> +<sql-statement> +select 33 >= all ('{1,2,33}'); +</sql-statement> +<sql-statement> +-- boundary cases +select null::int >= all ('{1,2,33}'); +</sql-statement> +<sql-statement> +select null::int >= all ('{}'); +</sql-statement> +<sql-statement> +select null::int >= any ('{}'); +</sql-statement> +<sql-statement> +-- cross-datatype +select 33.4 = any (array[1,2,3]); +</sql-statement> +<sql-statement> +select 33.4 > all (array[1,2,3]); +</sql-statement> +<sql-statement> +-- errors +select 33 * any ('{1,2,3}'); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + -- errors + ^ + -stdin-:<main>:2:11: Error: At function: PgAnyResolvedOp + select 33 * any ('{1,2,3}'); + ^ + -stdin-:<main>:2:11: Error: Expected boolean operator result, but got: int4 + select 33 * any ('{1,2,3}'); + ^ +<sql-statement> +select 33 * any (44); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + select 33 * any (44); + ^ + -stdin-:<main>:1:11: Error: At function: PgAnyOp + select 33 * any (44); + ^ + -stdin-:<main>:1:11: Error: ydb/library/yql/parser/pg_catalog/catalog.cpp:2143: Condition violated: `fromTypePtr' + select 33 * any (44); + ^ +<sql-statement> +-- nulls +select 33 = any (null::int[]); +</sql-statement> +<sql-statement> +select null::int = any ('{1,2,3}'); +</sql-statement> +<sql-statement> +select 33 = any ('{1,null,3}'); +</sql-statement> +<sql-statement> +select 33 = any ('{1,null,33}'); +</sql-statement> +<sql-statement> +select 33 = all (null::int[]); +</sql-statement> +<sql-statement> +select null::int = all ('{1,2,3}'); +</sql-statement> +<sql-statement> +select 33 = all ('{1,null,3}'); +</sql-statement> +<sql-statement> +select 33 = all ('{33,null,33}'); +</sql-statement> +<sql-statement> +-- nulls later in the bitmap +SELECT -1 != ALL(ARRAY(SELECT NULLIF(g.i, 900) FROM generate_series(1,1000) g(i))); +</sql-statement> +<sql-statement> +-- test indexes on arrays +create temp table arr_tbl (f1 int[] unique); +</sql-statement> +<sql-statement> +insert into arr_tbl values ('{1,2,3}'); +</sql-statement> +-stdin-:<main>: Fatal: Execution + + -stdin-:<main>:1:1: Fatal: Execution of node: YtFill! + insert into arr_tbl values ('{1,2,3}'); + ^ + -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type integer: "{1,2,3}" + + insert into arr_tbl values ('{1,2,3}'); + ^ +<sql-statement> +insert into arr_tbl values ('{1,2}'); +</sql-statement> +-stdin-:<main>: Fatal: Execution + + -stdin-:<main>:1:1: Fatal: Execution of node: YtFill! + insert into arr_tbl values ('{1,2}'); + ^ + -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type integer: "{1,2}" + + insert into arr_tbl values ('{1,2}'); + ^ +<sql-statement> +-- failure expected: +insert into arr_tbl values ('{1,2,3}'); +</sql-statement> +-stdin-:<main>: Fatal: Execution + + -stdin-:<main>:1:1: Fatal: Execution of node: YtFill! + -- failure expected: + ^ + -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type integer: "{1,2,3}" + + -- failure expected: + ^ +<sql-statement> +insert into arr_tbl values ('{2,3,4}'); +</sql-statement> +-stdin-:<main>: Fatal: Execution + + -stdin-:<main>:1:1: Fatal: Execution of node: YtFill! + insert into arr_tbl values ('{2,3,4}'); + ^ + -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type integer: "{2,3,4}" + + insert into arr_tbl values ('{2,3,4}'); + ^ +<sql-statement> +insert into arr_tbl values ('{1,5,3}'); +</sql-statement> +-stdin-:<main>: Fatal: Execution + + -stdin-:<main>:1:1: Fatal: Execution of node: YtFill! + insert into arr_tbl values ('{1,5,3}'); + ^ + -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type integer: "{1,5,3}" + + insert into arr_tbl values ('{1,5,3}'); + ^ +<sql-statement> +insert into arr_tbl values ('{1,2,10}'); +</sql-statement> +-stdin-:<main>: Fatal: Execution + + -stdin-:<main>:1:1: Fatal: Execution of node: YtFill! + insert into arr_tbl values ('{1,2,10}'); + ^ + -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type integer: "{1,2,10}" + + insert into arr_tbl values ('{1,2,10}'); + ^ +<sql-statement> +set enable_seqscan to off; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_seqscan + set enable_seqscan to off; + ^ +<sql-statement> +set enable_bitmapscan to off; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: VariableSetStmt, not supported name: enable_bitmapscan + set enable_bitmapscan to off; + ^ +<sql-statement> +select * from arr_tbl where f1 > '{1,2,3}' and f1 <= '{1,5,3}'; +</sql-statement> +<sql-statement> +select * from arr_tbl where f1 >= '{1,2,3}' and f1 < '{1,5,3}'; +</sql-statement> +<sql-statement> +-- test ON CONFLICT DO UPDATE with arrays +create temp table arr_pk_tbl (pk int4 primary key, f1 int[]); +</sql-statement> +<sql-statement> +insert into arr_pk_tbl values (1, '{1,2,3}'); +</sql-statement> +-stdin-:<main>: Fatal: Execution + + -stdin-:<main>:1:1: Fatal: Execution of node: YtFill! + insert into arr_pk_tbl values (1, '{1,2,3}'); + ^ + -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type integer: "{1,2,3}" + + insert into arr_pk_tbl values (1, '{1,2,3}'); + ^ +<sql-statement> +insert into arr_pk_tbl values (1, '{3,4,5}') on conflict (pk) + do update set f1[1] = excluded.f1[1], f1[3] = excluded.f1[3] + returning pk, f1; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: InsertStmt: not supported onConflictClause + insert into arr_pk_tbl values (1, '{3,4,5}') on conflict (pk) + ^ +<sql-statement> +insert into arr_pk_tbl(pk, f1[1:2]) values (1, '{6,7,8}') on conflict (pk) + do update set f1[1] = excluded.f1[1], + f1[2] = excluded.f1[2], + f1[3] = excluded.f1[3] + returning pk, f1; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: InsertStmt: not supported onConflictClause + insert into arr_pk_tbl(pk, f1[1:2]) values (1, '{6,7,8}') on conflict (pk) + ^ +<sql-statement> +-- note: if above selects don't produce the expected tuple order, +-- then you didn't get an indexscan plan, and something is busted. +reset enable_seqscan; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4 + -- note: if above selects don't produce the expected tuple order, + ^ +<sql-statement> +reset enable_bitmapscan; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4 + reset enable_bitmapscan; + ^ +<sql-statement> +-- test [not] (like|ilike) (any|all) (...) +select 'foo' like any (array['%a', '%o']); -- t +</sql-statement> +<sql-statement> +select 'foo' like any (array['%a', '%b']); -- f +</sql-statement> +<sql-statement> +select 'foo' like all (array['f%', '%o']); -- t +</sql-statement> +<sql-statement> +select 'foo' like all (array['f%', '%b']); -- f +</sql-statement> +<sql-statement> +select 'foo' not like any (array['%a', '%b']); -- t +</sql-statement> +<sql-statement> +select 'foo' not like all (array['%a', '%o']); -- f +</sql-statement> +<sql-statement> +select 'foo' ilike any (array['%A', '%O']); -- t +</sql-statement> +<sql-statement> +select 'foo' ilike all (array['F%', '%O']); -- t +</sql-statement> +<sql-statement> +-- +-- General array parser tests +-- +-- none of the following should be accepted +select '{{1,{2}},{2,3}}'::text[]; +</sql-statement> +-stdin-:<main>: Fatal: Execution + + -stdin-:<main>:1:1: Fatal: Execution of node: Result + -- + ^ + -stdin-:<main>:1:1: Fatal: ERROR: malformed array literal: "{{1,{2}},{2,3}}" +DETAIL: Unexpected "{" character. + + -- + ^ +<sql-statement> +select '{{},{}}'::text[]; +</sql-statement> +-stdin-:<main>: Fatal: Execution + + -stdin-:<main>:1:1: Fatal: Execution of node: Result + select '{{},{}}'::text[]; + ^ + -stdin-:<main>:1:1: Fatal: ERROR: malformed array literal: "{{},{}}" +DETAIL: Unexpected "}" character. + + select '{{},{}}'::text[]; + ^ +<sql-statement> +select E'{{1,2},\\{2,3}}'::text[]; +</sql-statement> +-stdin-:<main>: Fatal: Execution + + -stdin-:<main>:1:1: Fatal: Execution of node: Result + select E'{{1,2},\\{2,3}}'::text[]; + ^ + -stdin-:<main>:1:1: Fatal: ERROR: malformed array literal: "{{1,2},\{2,3}}" +DETAIL: Unexpected "\" character. + + select E'{{1,2},\\{2,3}}'::text[]; + ^ +<sql-statement> +select '{{"1 2" x},{3}}'::text[]; +</sql-statement> +-stdin-:<main>: Fatal: Execution + + -stdin-:<main>:1:1: Fatal: Execution of node: Result + select '{{"1 2" x},{3}}'::text[]; + ^ + -stdin-:<main>:1:1: Fatal: ERROR: malformed array literal: "{{"1 2" x},{3}}" +DETAIL: Unexpected array element. + + select '{{"1 2" x},{3}}'::text[]; + ^ +<sql-statement> +select '{}}'::text[]; +</sql-statement> +-stdin-:<main>: Fatal: Execution + + -stdin-:<main>:1:1: Fatal: Execution of node: Result + select '{}}'::text[]; + ^ + -stdin-:<main>:1:1: Fatal: ERROR: malformed array literal: "{}}" +DETAIL: Junk after closing right brace. + + select '{}}'::text[]; + ^ +<sql-statement> +select '{ }}'::text[]; +</sql-statement> +-stdin-:<main>: Fatal: Execution + + -stdin-:<main>:1:1: Fatal: Execution of node: Result + select '{ }}'::text[]; + ^ + -stdin-:<main>:1:1: Fatal: ERROR: malformed array literal: "{ }}" +DETAIL: Junk after closing right brace. + + select '{ }}'::text[]; + ^ +<sql-statement> +select array[]; +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + select array[]; + ^ + -stdin-:<main>:1:8: Error: At function: PgArray + select array[]; + ^ + -stdin-:<main>:1:8: Error: Expected at least 1 argument(s), but got 0 + select array[]; + ^ +<sql-statement> +-- none of the above should be accepted +-- all of the following should be accepted +select '{}'::text[]; +</sql-statement> +<sql-statement> +select '{{{1,2,3,4},{2,3,4,5}},{{3,4,5,6},{4,5,6,7}}}'::text[]; +</sql-statement> +<sql-statement> +select '{0 second ,0 second}'::interval[]; +</sql-statement> +<sql-statement> +select '{ { "," } , { 3 } }'::text[]; +</sql-statement> +<sql-statement> +select ' { { " 0 second " , 0 second } }'::text[]; +</sql-statement> +<sql-statement> +select '{ + 0 second, + @ 1 hour @ 42 minutes @ 20 seconds + }'::interval[]; +</sql-statement> +<sql-statement> +select array[]::text[]; +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + select array[]::text[]; + ^ + -stdin-:<main>:1:17: Error: At function: PgCast + select array[]::text[]; + ^ + -stdin-:<main>:1:8: Error: At function: PgArray + select array[]::text[]; + ^ + -stdin-:<main>:1:8: Error: Expected at least 1 argument(s), but got 0 + select array[]::text[]; + ^ +<sql-statement> +select '[0:1]={1.1,2.2}'::float8[]; +</sql-statement> +<sql-statement> +-- all of the above should be accepted +-- tests for array aggregates +CREATE TEMP TABLE arraggtest ( f1 INT[], f2 TEXT[][], f3 FLOAT[]); +</sql-statement> +<sql-statement> +INSERT INTO arraggtest (f1, f2, f3) VALUES +('{1,2,3,4}','{{grey,red},{blue,blue}}','{1.6, 0.0}'); +</sql-statement> +-stdin-:<main>: Fatal: Execution + + -stdin-:<main>:1:1: Fatal: Execution of node: YtFill! + INSERT INTO arraggtest (f1, f2, f3) VALUES + ^ + -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type integer: "{1,2,3,4}" + + INSERT INTO arraggtest (f1, f2, f3) VALUES + ^ +<sql-statement> +INSERT INTO arraggtest (f1, f2, f3) VALUES +('{1,2,3}','{{grey,red},{grey,blue}}','{1.6}'); +</sql-statement> +-stdin-:<main>: Fatal: Execution + + -stdin-:<main>:1:1: Fatal: Execution of node: YtFill! + INSERT INTO arraggtest (f1, f2, f3) VALUES + ^ + -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type integer: "{1,2,3}" + + INSERT INTO arraggtest (f1, f2, f3) VALUES + ^ +<sql-statement> +SELECT max(f1), min(f1), max(f2), min(f2), max(f3), min(f3) FROM arraggtest; +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem + SELECT max(f1), min(f1), max(f2), min(f2), max(f3), min(f3) FROM arraggtest; + ^ + -stdin-:<main>:1:1: Error: Duplicated member: max + SELECT max(f1), min(f1), max(f2), min(f2), max(f3), min(f3) FROM arraggtest; + ^ +<sql-statement> +INSERT INTO arraggtest (f1, f2, f3) VALUES +('{3,3,2,4,5,6}','{{white,yellow},{pink,orange}}','{2.1,3.3,1.8,1.7,1.6}'); +</sql-statement> +-stdin-:<main>: Fatal: Execution + + -stdin-:<main>:1:1: Fatal: Execution of node: YtFill! + INSERT INTO arraggtest (f1, f2, f3) VALUES + ^ + -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type integer: "{3,3,2,4,5,6}" + + INSERT INTO arraggtest (f1, f2, f3) VALUES + ^ +<sql-statement> +SELECT max(f1), min(f1), max(f2), min(f2), max(f3), min(f3) FROM arraggtest; +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem + SELECT max(f1), min(f1), max(f2), min(f2), max(f3), min(f3) FROM arraggtest; + ^ + -stdin-:<main>:1:1: Error: Duplicated member: max + SELECT max(f1), min(f1), max(f2), min(f2), max(f3), min(f3) FROM arraggtest; + ^ +<sql-statement> +INSERT INTO arraggtest (f1, f2, f3) VALUES +('{2}','{{black,red},{green,orange}}','{1.6,2.2,2.6,0.4}'); +</sql-statement> +-stdin-:<main>: Fatal: Execution + + -stdin-:<main>:1:1: Fatal: Execution of node: YtFill! + INSERT INTO arraggtest (f1, f2, f3) VALUES + ^ + -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type integer: "{2}" + + INSERT INTO arraggtest (f1, f2, f3) VALUES + ^ +<sql-statement> +SELECT max(f1), min(f1), max(f2), min(f2), max(f3), min(f3) FROM arraggtest; +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem + SELECT max(f1), min(f1), max(f2), min(f2), max(f3), min(f3) FROM arraggtest; + ^ + -stdin-:<main>:1:1: Error: Duplicated member: max + SELECT max(f1), min(f1), max(f2), min(f2), max(f3), min(f3) FROM arraggtest; + ^ +<sql-statement> +INSERT INTO arraggtest (f1, f2, f3) VALUES +('{4,2,6,7,8,1}','{{red},{black},{purple},{blue},{blue}}',NULL); +</sql-statement> +-stdin-:<main>: Fatal: Execution + + -stdin-:<main>:1:1: Fatal: Execution of node: YtFill! + INSERT INTO arraggtest (f1, f2, f3) VALUES + ^ + -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type integer: "{4,2,6,7,8,1}" + + INSERT INTO arraggtest (f1, f2, f3) VALUES + ^ +<sql-statement> +SELECT max(f1), min(f1), max(f2), min(f2), max(f3), min(f3) FROM arraggtest; +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem + SELECT max(f1), min(f1), max(f2), min(f2), max(f3), min(f3) FROM arraggtest; + ^ + -stdin-:<main>:1:1: Error: Duplicated member: max + SELECT max(f1), min(f1), max(f2), min(f2), max(f3), min(f3) FROM arraggtest; + ^ +<sql-statement> +INSERT INTO arraggtest (f1, f2, f3) VALUES +('{}','{{pink,white,blue,red,grey,orange}}','{2.1,1.87,1.4,2.2}'); +</sql-statement> +-stdin-:<main>: Fatal: Execution + + -stdin-:<main>:1:1: Fatal: Execution of node: YtFill! + INSERT INTO arraggtest (f1, f2, f3) VALUES + ^ + -stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type integer: "{}" + + INSERT INTO arraggtest (f1, f2, f3) VALUES + ^ +<sql-statement> +SELECT max(f1), min(f1), max(f2), min(f2), max(f3), min(f3) FROM arraggtest; +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem + SELECT max(f1), min(f1), max(f2), min(f2), max(f3), min(f3) FROM arraggtest; + ^ + -stdin-:<main>:1:1: Error: Duplicated member: max + SELECT max(f1), min(f1), max(f2), min(f2), max(f3), min(f3) FROM arraggtest; + ^ +<sql-statement> +-- A few simple tests for arrays of composite types +create type comptype as (f1 int, f2 text); +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 314 + -- A few simple tests for arrays of composite types + ^ +<sql-statement> +create table comptable (c1 comptype, c2 comptype[]); +</sql-statement> +<sql-statement> +-- XXX would like to not have to specify row() construct types here ... +insert into comptable + values (row(1,'foo'), array[row(2,'bar')::comptype, row(3,'baz')::comptype]); +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: alternative is not implemented yet : 138 + -- XXX would like to not have to specify row() construct types here ... + ^ +<sql-statement> +-- check that implicitly named array type _comptype isn't a problem +create type _comptype as enum('fooey'); +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 315 + -- check that implicitly named array type _comptype isn't a problem + ^ +<sql-statement> +select * from comptable; +</sql-statement> +-stdin-:<main>: Fatal: Table metadata loading + + -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.comptable + +<sql-statement> +select c2[2].f2 from comptable; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: alternative is not implemented yet : 360 + select c2[2].f2 from comptable; + ^ +<sql-statement> +drop type _comptype; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 373 + drop type _comptype; + ^ +<sql-statement> +drop table comptable; +</sql-statement> +<sql-statement> +drop type comptype; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 373 + drop type comptype; + ^ +<sql-statement> +create or replace function unnest1(anyarray) +returns setof anyelement as $$ +select $1[s] from generate_subscripts($1,1) g(s); +$$ language sql immutable; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261 + create or replace function unnest1(anyarray) + ^ +<sql-statement> +create or replace function unnest2(anyarray) +returns setof anyelement as $$ +select $1[s1][s2] from generate_subscripts($1,1) g1(s1), + generate_subscripts($1,2) g2(s2); +$$ language sql immutable; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261 + create or replace function unnest2(anyarray) + ^ +<sql-statement> +select * from unnest1(array[1,2,3]); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem + select * from unnest1(array[1,2,3]); + ^ + -stdin-:<main>:1:15: Error: At function: PgCall + select * from unnest1(array[1,2,3]); + ^ + -stdin-:<main>:1:15: Error: No such proc: unnest1 + select * from unnest1(array[1,2,3]); + ^ +<sql-statement> +select * from unnest2(array[[1,2,3],[4,5,6]]); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem + select * from unnest2(array[[1,2,3],[4,5,6]]); + ^ + -stdin-:<main>:1:15: Error: At function: PgCall + select * from unnest2(array[[1,2,3],[4,5,6]]); + ^ + -stdin-:<main>:1:15: Error: No such proc: unnest2 + select * from unnest2(array[[1,2,3],[4,5,6]]); + ^ +<sql-statement> +drop function unnest1(anyarray); +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 386 + drop function unnest1(anyarray); + ^ +<sql-statement> +drop function unnest2(anyarray); +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 386 + drop function unnest2(anyarray); + ^ +<sql-statement> +select array_fill(null::integer, array[3,3],array[2,2]); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + select array_fill(null::integer, array[3,3],array[2,2]); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + select array_fill(null::integer, array[3,3],array[2,2]); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_fill with given argument types: (int4,_int4,_int4) + select array_fill(null::integer, array[3,3],array[2,2]); + ^ +<sql-statement> +select array_fill(null::integer, array[3,3]); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + select array_fill(null::integer, array[3,3]); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + select array_fill(null::integer, array[3,3]); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_fill with given argument types: (int4,_int4) + select array_fill(null::integer, array[3,3]); + ^ +<sql-statement> +select array_fill(null::text, array[3,3],array[2,2]); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + select array_fill(null::text, array[3,3],array[2,2]); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + select array_fill(null::text, array[3,3],array[2,2]); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_fill with given argument types: (text,_int4,_int4) + select array_fill(null::text, array[3,3],array[2,2]); + ^ +<sql-statement> +select array_fill(null::text, array[3,3]); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + select array_fill(null::text, array[3,3]); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + select array_fill(null::text, array[3,3]); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_fill with given argument types: (text,_int4) + select array_fill(null::text, array[3,3]); + ^ +<sql-statement> +select array_fill(7, array[3,3],array[2,2]); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + select array_fill(7, array[3,3],array[2,2]); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + select array_fill(7, array[3,3],array[2,2]); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_fill with given argument types: (int4,_int4,_int4) + select array_fill(7, array[3,3],array[2,2]); + ^ +<sql-statement> +select array_fill(7, array[3,3]); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + select array_fill(7, array[3,3]); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + select array_fill(7, array[3,3]); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_fill with given argument types: (int4,_int4) + select array_fill(7, array[3,3]); + ^ +<sql-statement> +select array_fill('juhu'::text, array[3,3],array[2,2]); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + select array_fill('juhu'::text, array[3,3],array[2,2]); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + select array_fill('juhu'::text, array[3,3],array[2,2]); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_fill with given argument types: (text,_int4,_int4) + select array_fill('juhu'::text, array[3,3],array[2,2]); + ^ +<sql-statement> +select array_fill('juhu'::text, array[3,3]); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + select array_fill('juhu'::text, array[3,3]); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + select array_fill('juhu'::text, array[3,3]); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_fill with given argument types: (text,_int4) + select array_fill('juhu'::text, array[3,3]); + ^ +<sql-statement> +select a, a = '{}' as is_eq, array_dims(a) + from (select array_fill(42, array[0]) as a) ss; +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + select a, a = '{}' as is_eq, array_dims(a) + ^ + -stdin-:<main>:2:16: Error: At function: PgCall + from (select array_fill(42, array[0]) as a) ss; + ^ + -stdin-:<main>:2:16: Error: Unable to find an overload for proc array_fill with given argument types: (int4,_int4) + from (select array_fill(42, array[0]) as a) ss; + ^ +<sql-statement> +select a, a = '{}' as is_eq, array_dims(a) + from (select array_fill(42, '{}') as a) ss; +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + select a, a = '{}' as is_eq, array_dims(a) + ^ + -stdin-:<main>:2:16: Error: At function: PgCall + from (select array_fill(42, '{}') as a) ss; + ^ + -stdin-:<main>:2:16: Error: Unable to find an overload for proc array_fill with given argument types: (int4,unknown) + from (select array_fill(42, '{}') as a) ss; + ^ +<sql-statement> +select a, a = '{}' as is_eq, array_dims(a) + from (select array_fill(42, '{}', '{}') as a) ss; +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + select a, a = '{}' as is_eq, array_dims(a) + ^ + -stdin-:<main>:2:16: Error: At function: PgCall + from (select array_fill(42, '{}', '{}') as a) ss; + ^ + -stdin-:<main>:2:16: Error: Unable to find an overload for proc array_fill with given argument types: (int4,unknown,unknown) + from (select array_fill(42, '{}', '{}') as a) ss; + ^ +<sql-statement> +-- raise exception +select array_fill(1, null, array[2,2]); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + -- raise exception + ^ + -stdin-:<main>:2:8: Error: At function: PgCall + select array_fill(1, null, array[2,2]); + ^ + -stdin-:<main>:2:8: Error: Unable to find an overload for proc array_fill with given argument types: (int4,unknown,_int4) + select array_fill(1, null, array[2,2]); + ^ +<sql-statement> +select array_fill(1, array[2,2], null); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + select array_fill(1, array[2,2], null); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + select array_fill(1, array[2,2], null); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_fill with given argument types: (int4,_int4,unknown) + select array_fill(1, array[2,2], null); + ^ +<sql-statement> +select array_fill(1, array[2,2], '{}'); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + select array_fill(1, array[2,2], '{}'); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + select array_fill(1, array[2,2], '{}'); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_fill with given argument types: (int4,_int4,unknown) + select array_fill(1, array[2,2], '{}'); + ^ +<sql-statement> +select array_fill(1, array[3,3], array[1,1,1]); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + select array_fill(1, array[3,3], array[1,1,1]); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + select array_fill(1, array[3,3], array[1,1,1]); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_fill with given argument types: (int4,_int4,_int4) + select array_fill(1, array[3,3], array[1,1,1]); + ^ +<sql-statement> +select array_fill(1, array[1,2,null]); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + select array_fill(1, array[1,2,null]); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + select array_fill(1, array[1,2,null]); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_fill with given argument types: (int4,_int4) + select array_fill(1, array[1,2,null]); + ^ +<sql-statement> +select array_fill(1, array[[1,2],[3,4]]); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + select array_fill(1, array[[1,2],[3,4]]); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + select array_fill(1, array[[1,2],[3,4]]); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_fill with given argument types: (int4,_int4) + select array_fill(1, array[[1,2],[3,4]]); + ^ +<sql-statement> +select string_to_array('1|2|3', '|'); +</sql-statement> +<sql-statement> +select string_to_array('1|2|3|', '|'); +</sql-statement> +<sql-statement> +select string_to_array('1||2|3||', '||'); +</sql-statement> +<sql-statement> +select string_to_array('1|2|3', ''); +</sql-statement> +<sql-statement> +select string_to_array('', '|'); +</sql-statement> +<sql-statement> +select string_to_array('1|2|3', NULL); +</sql-statement> +<sql-statement> +select string_to_array(NULL, '|') IS NULL; +</sql-statement> +<sql-statement> +select string_to_array('abc', ''); +</sql-statement> +<sql-statement> +select string_to_array('abc', '', 'abc'); +</sql-statement> +<sql-statement> +select string_to_array('abc', ','); +</sql-statement> +<sql-statement> +select string_to_array('abc', ',', 'abc'); +</sql-statement> +<sql-statement> +select string_to_array('1,2,3,4,,6', ','); +</sql-statement> +<sql-statement> +select string_to_array('1,2,3,4,,6', ',', ''); +</sql-statement> +<sql-statement> +select string_to_array('1,2,3,4,*,6', ',', '*'); +</sql-statement> +<sql-statement> +select v, v is null as "is null" from string_to_table('1|2|3', '|') g(v); +</sql-statement> +<sql-statement> +select v, v is null as "is null" from string_to_table('1|2|3|', '|') g(v); +</sql-statement> +<sql-statement> +select v, v is null as "is null" from string_to_table('1||2|3||', '||') g(v); +</sql-statement> +<sql-statement> +select v, v is null as "is null" from string_to_table('1|2|3', '') g(v); +</sql-statement> +<sql-statement> +select v, v is null as "is null" from string_to_table('', '|') g(v); +</sql-statement> +<sql-statement> +select v, v is null as "is null" from string_to_table('1|2|3', NULL) g(v); +</sql-statement> +<sql-statement> +select v, v is null as "is null" from string_to_table(NULL, '|') g(v); +</sql-statement> +<sql-statement> +select v, v is null as "is null" from string_to_table('abc', '') g(v); +</sql-statement> +<sql-statement> +select v, v is null as "is null" from string_to_table('abc', '', 'abc') g(v); +</sql-statement> +<sql-statement> +select v, v is null as "is null" from string_to_table('abc', ',') g(v); +</sql-statement> +<sql-statement> +select v, v is null as "is null" from string_to_table('abc', ',', 'abc') g(v); +</sql-statement> +<sql-statement> +select v, v is null as "is null" from string_to_table('1,2,3,4,,6', ',') g(v); +</sql-statement> +<sql-statement> +select v, v is null as "is null" from string_to_table('1,2,3,4,,6', ',', '') g(v); +</sql-statement> +<sql-statement> +select v, v is null as "is null" from string_to_table('1,2,3,4,*,6', ',', '*') g(v); +</sql-statement> +<sql-statement> +select array_to_string(NULL::int4[], ',') IS NULL; +</sql-statement> +<sql-statement> +select array_to_string('{}'::int4[], ','); +</sql-statement> +<sql-statement> +select array_to_string(array[1,2,3,4,NULL,6], ','); +</sql-statement> +<sql-statement> +select array_to_string(array[1,2,3,4,NULL,6], ',', '*'); +</sql-statement> +<sql-statement> +select array_to_string(array[1,2,3,4,NULL,6], NULL); +</sql-statement> +<sql-statement> +select array_to_string(array[1,2,3,4,NULL,6], ',', NULL); +</sql-statement> +<sql-statement> +select array_to_string(string_to_array('1|2|3', '|'), '|'); +</sql-statement> +<sql-statement> +select array_length(array[1,2,3], 1); +</sql-statement> +<sql-statement> +select array_length(array[[1,2,3], [4,5,6]], 0); +</sql-statement> +<sql-statement> +select array_length(array[[1,2,3], [4,5,6]], 1); +</sql-statement> +<sql-statement> +select array_length(array[[1,2,3], [4,5,6]], 2); +</sql-statement> +<sql-statement> +select array_length(array[[1,2,3], [4,5,6]], 3); +</sql-statement> +<sql-statement> +select cardinality(NULL::int[]); +</sql-statement> +<sql-statement> +select cardinality('{}'::int[]); +</sql-statement> +<sql-statement> +select cardinality(array[1,2,3]); +</sql-statement> +<sql-statement> +select cardinality('[2:4]={5,6,7}'::int[]); +</sql-statement> +<sql-statement> +select cardinality('{{1,2}}'::int[]); +</sql-statement> +<sql-statement> +select cardinality('{{1,2},{3,4},{5,6}}'::int[]); +</sql-statement> +<sql-statement> +select cardinality('{{{1,9},{5,6}},{{2,3},{3,4}}}'::int[]); +</sql-statement> +<sql-statement> +-- array_agg(anynonarray) +select array_agg(unique1) from (select unique1 from tenk1 where unique1 < 15 order by unique1) ss; +</sql-statement> +<sql-statement> +select array_agg(ten) from (select ten from tenk1 where unique1 < 15 order by unique1) ss; +</sql-statement> +<sql-statement> +select array_agg(nullif(ten, 4)) from (select ten from tenk1 where unique1 < 15 order by unique1) ss; +</sql-statement> +<sql-statement> +select array_agg(unique1) from tenk1 where unique1 < -15; +</sql-statement> +<sql-statement> +-- array_agg(anyarray) +select array_agg(ar) + from (values ('{1,2}'::int[]), ('{3,4}'::int[])) v(ar); +</sql-statement> +<sql-statement> +select array_agg(distinct ar order by ar desc) + from (select array[i / 2] from generate_series(1,10) a(i)) b(ar); +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:8: Error: FuncCall: unsupported agg_order + select array_agg(distinct ar order by ar desc) + ^ +<sql-statement> +select array_agg(ar) + from (select array_agg(array[i, i+1, i-1]) + from generate_series(1,2) a(i)) b(ar); +</sql-statement> +<sql-statement> +select array_agg(array[i+1.2, i+1.3, i+1.4]) from generate_series(1,3) g(i); +</sql-statement> +<sql-statement> +select array_agg(array['Hello', i::text]) from generate_series(9,11) g(i); +</sql-statement> +<sql-statement> +select array_agg(array[i, nullif(i, 3), i+1]) from generate_series(1,4) g(i); +</sql-statement> +<sql-statement> +-- errors +select array_agg('{}'::int[]) from generate_series(1,2); +</sql-statement> +-stdin-:<main>: Fatal: Execution + + -stdin-:<main>:1:1: Fatal: Execution of node: Result + -- errors + ^ + -stdin-:<main>:1:1: Fatal: ERROR: cannot accumulate empty arrays + + -- errors + ^ +<sql-statement> +select array_agg(null::int[]) from generate_series(1,2); +</sql-statement> +-stdin-:<main>: Fatal: Execution + + -stdin-:<main>:1:1: Fatal: Execution of node: Result + select array_agg(null::int[]) from generate_series(1,2); + ^ + -stdin-:<main>:1:1: Fatal: ERROR: cannot accumulate null arrays + + select array_agg(null::int[]) from generate_series(1,2); + ^ +<sql-statement> +select array_agg(ar) + from (values ('{1,2}'::int[]), ('{3}'::int[])) v(ar); +</sql-statement> +-stdin-:<main>: Fatal: Execution + + -stdin-:<main>:1:1: Fatal: Execution of node: Result + select array_agg(ar) + ^ + -stdin-:<main>:1:1: Fatal: ERROR: cannot accumulate arrays of different dimensionality + + select array_agg(ar) + ^ +<sql-statement> +select unnest(array[1,2,3]); +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT + select unnest(array[1,2,3]); + ^ +<sql-statement> +select * from unnest(array[1,2,3]); +</sql-statement> +<sql-statement> +select unnest(array[1,2,3,4.5]::float8[]); +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT + select unnest(array[1,2,3,4.5]::float8[]); + ^ +<sql-statement> +select unnest(array[1,2,3,4.5]::numeric[]); +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT + select unnest(array[1,2,3,4.5]::numeric[]); + ^ +<sql-statement> +select unnest(array[1,2,3,null,4,null,null,5,6]); +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT + select unnest(array[1,2,3,null,4,null,null,5,6]); + ^ +<sql-statement> +select unnest(array[1,2,3,null,4,null,null,5,6]::text[]); +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:8: Error: Generator functions are not allowed in: SELECT + select unnest(array[1,2,3,null,4,null,null,5,6]::text[]); + ^ +<sql-statement> +select abs(unnest(array[1,2,null,-3])); +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:12: Error: Generator functions are not allowed in: SELECT + select abs(unnest(array[1,2,null,-3])); + ^ +<sql-statement> +select array_remove(array[1,2,2,3], 2); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + select array_remove(array[1,2,2,3], 2); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + select array_remove(array[1,2,2,3], 2); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_remove with given argument types: (_int4,int4) + select array_remove(array[1,2,2,3], 2); + ^ +<sql-statement> +select array_remove(array[1,2,2,3], 5); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + select array_remove(array[1,2,2,3], 5); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + select array_remove(array[1,2,2,3], 5); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_remove with given argument types: (_int4,int4) + select array_remove(array[1,2,2,3], 5); + ^ +<sql-statement> +select array_remove(array[1,NULL,NULL,3], NULL); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + select array_remove(array[1,NULL,NULL,3], NULL); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + select array_remove(array[1,NULL,NULL,3], NULL); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_remove with given argument types: (_int4,unknown) + select array_remove(array[1,NULL,NULL,3], NULL); + ^ +<sql-statement> +select array_remove(array['A','CC','D','C','RR'], 'RR'); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + select array_remove(array['A','CC','D','C','RR'], 'RR'); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + select array_remove(array['A','CC','D','C','RR'], 'RR'); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_remove with given argument types: (_text,unknown) + select array_remove(array['A','CC','D','C','RR'], 'RR'); + ^ +<sql-statement> +select array_remove(array[1.0, 2.1, 3.3], 1); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + select array_remove(array[1.0, 2.1, 3.3], 1); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + select array_remove(array[1.0, 2.1, 3.3], 1); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_remove with given argument types: (_numeric,int4) + select array_remove(array[1.0, 2.1, 3.3], 1); + ^ +<sql-statement> +select array_remove('{{1,2,2},{1,4,3}}', 2); -- not allowed +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + select array_remove('{{1,2,2},{1,4,3}}', 2); -- not allowed + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + select array_remove('{{1,2,2},{1,4,3}}', 2); -- not allowed + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_remove with given argument types: (unknown,int4) + select array_remove('{{1,2,2},{1,4,3}}', 2); -- not allowed + ^ +<sql-statement> +select array_remove(array['X','X','X'], 'X') = '{}'; +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + select array_remove(array['X','X','X'], 'X') = '{}'; + ^ + -stdin-:<main>:1:46: Error: At function: PgOp + select array_remove(array['X','X','X'], 'X') = '{}'; + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + select array_remove(array['X','X','X'], 'X') = '{}'; + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_remove with given argument types: (_text,unknown) + select array_remove(array['X','X','X'], 'X') = '{}'; + ^ +<sql-statement> +select array_replace(array[1,2,5,4],5,3); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + select array_replace(array[1,2,5,4],5,3); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + select array_replace(array[1,2,5,4],5,3); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_replace with given argument types: (_int4,int4,int4) + select array_replace(array[1,2,5,4],5,3); + ^ +<sql-statement> +select array_replace(array[1,2,5,4],5,NULL); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + select array_replace(array[1,2,5,4],5,NULL); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + select array_replace(array[1,2,5,4],5,NULL); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_replace with given argument types: (_int4,int4,unknown) + select array_replace(array[1,2,5,4],5,NULL); + ^ +<sql-statement> +select array_replace(array[1,2,NULL,4,NULL],NULL,5); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + select array_replace(array[1,2,NULL,4,NULL],NULL,5); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + select array_replace(array[1,2,NULL,4,NULL],NULL,5); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_replace with given argument types: (_int4,unknown,int4) + select array_replace(array[1,2,NULL,4,NULL],NULL,5); + ^ +<sql-statement> +select array_replace(array['A','B','DD','B'],'B','CC'); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + select array_replace(array['A','B','DD','B'],'B','CC'); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + select array_replace(array['A','B','DD','B'],'B','CC'); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_replace with given argument types: (_text,unknown,unknown) + select array_replace(array['A','B','DD','B'],'B','CC'); + ^ +<sql-statement> +select array_replace(array[1,NULL,3],NULL,NULL); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + select array_replace(array[1,NULL,3],NULL,NULL); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + select array_replace(array[1,NULL,3],NULL,NULL); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_replace with given argument types: (_int4,unknown,unknown) + select array_replace(array[1,NULL,3],NULL,NULL); + ^ +<sql-statement> +select array_replace(array['AB',NULL,'CDE'],NULL,'12'); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + select array_replace(array['AB',NULL,'CDE'],NULL,'12'); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + select array_replace(array['AB',NULL,'CDE'],NULL,'12'); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc array_replace with given argument types: (_text,unknown,unknown) + select array_replace(array['AB',NULL,'CDE'],NULL,'12'); + ^ +<sql-statement> +-- array(select array-value ...) +select array(select array[i,i/2] from generate_series(1,5) i); +</sql-statement> +<sql-statement> +select array(select array['Hello', i::text] from generate_series(9,11) i); +</sql-statement> +<sql-statement> +-- Insert/update on a column that is array of composite +create temp table t1 (f1 int8_tbl[]); +</sql-statement> +<sql-statement> +insert into t1 (f1[5].q1) values(42); +</sql-statement> +-stdin-:<main>: Fatal: Table metadata loading + + -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.t1 + +<sql-statement> +select * from t1; +</sql-statement> +-stdin-:<main>: Fatal: Table metadata loading + + -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.t1 + +<sql-statement> +update t1 set f1[5].q2 = 43; +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_update' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +select * from t1; +</sql-statement> +-stdin-:<main>: Fatal: Table metadata loading + + -stdin-:<main>: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.t1 + +<sql-statement> +-- Check that arrays of composites are safely detoasted when needed +create temp table src (f1 text); +</sql-statement> +<sql-statement> +insert into src + select string_agg(random()::text,'') from generate_series(1,10000); +</sql-statement> +<sql-statement> +create type textandtext as (c1 text, c2 text); +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 314 + create type textandtext as (c1 text, c2 text); + ^ +<sql-statement> +create temp table dest (f1 textandtext[]); +</sql-statement> +<sql-statement> +insert into dest select array[row(f1,f1)::textandtext] from src; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:43: Error: alternative is not implemented yet : 138 + insert into dest select array[row(f1,f1)::textandtext] from src; + ^ +<sql-statement> +select length(md5((f1[1]).c2)) from dest; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:15: Error: alternative is not implemented yet : 360 + select length(md5((f1[1]).c2)) from dest; + ^ +<sql-statement> +delete from src; +</sql-statement> +-stdin-:<main>: Fatal: Pre type annotation + + -stdin-:<main>: Fatal: tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp:70: Key 'pg_delete' not found in enum NYql::EYtSettingType. Valid options are: 'initial', 'infer_scheme', 'force_infer_schema', 'do_not_fail_on_invalid_schema', 'direct_read', 'view', 'mode', 'scheme', 'weak_concat', 'anonymous', 'with_qb', 'inline', 'sample', 'joinLabel', 'ignore_non_existing', 'warn_non_existing', 'xlock', 'unordered', 'nonUnique', 'userschema', 'usercolumns', 'statcolumns', 'syscolumns', 'ignoretypev3', 'memUsage', 'itemsCount', 'rowFactor', 'ordered', 'keyFilter', 'keyFilter2', 'take', 'skip', 'limit', 'sortLimitBy', 'sortBy', 'reduceBy', 'reduceFilterBy', 'forceTransform', 'weakFields', 'sharded', 'combineChunks', 'jobCount', 'joinReduce', 'firstAsPrimary', 'flow', 'keepSorted', 'keySwitch', 'uniqueBy', 'opHash', 'mapOutputType', 'reduceInputType', 'noDq', 'split', 'compression_codec', 'erasure_codec', 'expiration', 'replication_factor', 'user_attrs', 'media', 'primary_medium', 'keep_meta', 'monotonic_keys', 'mutationid'. + +<sql-statement> +select length(md5((f1[1]).c2)) from dest; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:15: Error: alternative is not implemented yet : 360 + select length(md5((f1[1]).c2)) from dest; + ^ +<sql-statement> +truncate table src; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 257 + truncate table src; + ^ +<sql-statement> +drop table src; +</sql-statement> +<sql-statement> +select length(md5((f1[1]).c2)) from dest; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:15: Error: alternative is not implemented yet : 360 + select length(md5((f1[1]).c2)) from dest; + ^ +<sql-statement> +drop table dest; +</sql-statement> +<sql-statement> +drop type textandtext; +</sql-statement> +-stdin-:<main>: Error: Parse Sql + + -stdin-:<main>:1:1: Error: DropStmt: alternative is not implemented yet : 373 + drop type textandtext; + ^ +<sql-statement> +-- Tests for polymorphic-array form of width_bucket() +-- this exercises the varwidth and float8 code paths +SELECT + op, + width_bucket(op::numeric, ARRAY[1, 3, 5, 10.0]::numeric[]) AS wb_n1, + width_bucket(op::numeric, ARRAY[0, 5.5, 9.99]::numeric[]) AS wb_n2, + width_bucket(op::numeric, ARRAY[-6, -5, 2.0]::numeric[]) AS wb_n3, + width_bucket(op::float8, ARRAY[1, 3, 5, 10.0]::float8[]) AS wb_f1, + width_bucket(op::float8, ARRAY[0, 5.5, 9.99]::float8[]) AS wb_f2, + width_bucket(op::float8, ARRAY[-6, -5, 2.0]::float8[]) AS wb_f3 +FROM (VALUES + (-5.2), + (-0.0000000001), + (0.000000000001), + (1), + (1.99999999999999), + (2), + (2.00000000000001), + (3), + (4), + (4.5), + (5), + (5.5), + (6), + (7), + (8), + (9), + (9.99999999999999), + (10), + (10.0000000000001) +) v(op); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem + -- Tests for polymorphic-array form of width_bucket() + ^ + -stdin-:<main>:1:1: Error: At function: PgResultItem + -- Tests for polymorphic-array form of width_bucket() + ^ + -stdin-:<main>:5:5: Error: At function: PgCall + width_bucket(op::numeric, ARRAY[1, 3, 5, 10.0]::numeric[]) AS wb_n1, + ^ + -stdin-:<main>:5:5: Error: Unable to find an overload for proc width_bucket with given argument types: (numeric,_numeric) + width_bucket(op::numeric, ARRAY[1, 3, 5, 10.0]::numeric[]) AS wb_n1, + ^ + -stdin-:<main>:1:1: Error: At function: PgResultItem + -- Tests for polymorphic-array form of width_bucket() + ^ + -stdin-:<main>:6:5: Error: At function: PgCall + width_bucket(op::numeric, ARRAY[0, 5.5, 9.99]::numeric[]) AS wb_n2, + ^ + -stdin-:<main>:6:5: Error: Unable to find an overload for proc width_bucket with given argument types: (numeric,_numeric) + width_bucket(op::numeric, ARRAY[0, 5.5, 9.99]::numeric[]) AS wb_n2, + ^ + -stdin-:<main>:1:1: Error: At function: PgResultItem + -- Tests for polymorphic-array form of width_bucket() + ^ + -stdin-:<main>:7:5: Error: At function: PgCall + width_bucket(op::numeric, ARRAY[-6, -5, 2.0]::numeric[]) AS wb_n3, + ^ + -stdin-:<main>:7:5: Error: Unable to find an overload for proc width_bucket with given argument types: (numeric,_numeric) + width_bucket(op::numeric, ARRAY[-6, -5, 2.0]::numeric[]) AS wb_n3, + ^ + -stdin-:<main>:1:1: Error: At function: PgResultItem + -- Tests for polymorphic-array form of width_bucket() + ^ + -stdin-:<main>:8:5: Error: At function: PgCall + width_bucket(op::float8, ARRAY[1, 3, 5, 10.0]::float8[]) AS wb_f1, + ^ + -stdin-:<main>:8:5: Error: Unable to find an overload for proc width_bucket with given argument types: (float8,_float8) + width_bucket(op::float8, ARRAY[1, 3, 5, 10.0]::float8[]) AS wb_f1, + ^ + -stdin-:<main>:1:1: Error: At function: PgResultItem + -- Tests for polymorphic-array form of width_bucket() + ^ + -stdin-:<main>:9:5: Error: At function: PgCall + width_bucket(op::float8, ARRAY[0, 5.5, 9.99]::float8[]) AS wb_f2, + ^ + -stdin-:<main>:9:5: Error: Unable to find an overload for proc width_bucket with given argument types: (float8,_float8) + width_bucket(op::float8, ARRAY[0, 5.5, 9.99]::float8[]) AS wb_f2, + ^ + -stdin-:<main>:1:1: Error: At function: PgResultItem + -- Tests for polymorphic-array form of width_bucket() + ^ + -stdin-:<main>:10:5: Error: At function: PgCall + width_bucket(op::float8, ARRAY[-6, -5, 2.0]::float8[]) AS wb_f3 + ^ + -stdin-:<main>:10:5: Error: Unable to find an overload for proc width_bucket with given argument types: (float8,_float8) + width_bucket(op::float8, ARRAY[-6, -5, 2.0]::float8[]) AS wb_f3 + ^ +<sql-statement> +-- ensure float8 path handles NaN properly +SELECT + op, + width_bucket(op, ARRAY[1, 3, 9, 'NaN', 'NaN']::float8[]) AS wb +FROM (VALUES + (-5.2::float8), + (4::float8), + (77::float8), + ('NaN'::float8) +) v(op); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + -- ensure float8 path handles NaN properly + ^ + -stdin-:<main>:4:5: Error: At function: PgCall + width_bucket(op, ARRAY[1, 3, 9, 'NaN', 'NaN']::float8[]) AS wb + ^ + -stdin-:<main>:4:5: Error: Unable to find an overload for proc width_bucket with given argument types: (float8,_float8) + width_bucket(op, ARRAY[1, 3, 9, 'NaN', 'NaN']::float8[]) AS wb + ^ +<sql-statement> +-- these exercise the generic fixed-width code path +SELECT + op, + width_bucket(op, ARRAY[1, 3, 5, 10]) AS wb_1 +FROM generate_series(0,11) as op; +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + -- these exercise the generic fixed-width code path + ^ + -stdin-:<main>:4:5: Error: At function: PgCall + width_bucket(op, ARRAY[1, 3, 5, 10]) AS wb_1 + ^ + -stdin-:<main>:4:5: Error: Unable to find an overload for proc width_bucket with given argument types: (int4,_int4) + width_bucket(op, ARRAY[1, 3, 5, 10]) AS wb_1 + ^ +<sql-statement> +SELECT width_bucket(now(), + array['yesterday', 'today', 'tomorrow']::timestamptz[]); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT width_bucket(now(), + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + SELECT width_bucket(now(), + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc width_bucket with given argument types: (timestamptz,_timestamptz) + SELECT width_bucket(now(), + ^ +<sql-statement> +-- corner cases +SELECT width_bucket(5, ARRAY[3]); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + -- corner cases + ^ + -stdin-:<main>:2:8: Error: At function: PgCall + SELECT width_bucket(5, ARRAY[3]); + ^ + -stdin-:<main>:2:8: Error: Unable to find an overload for proc width_bucket with given argument types: (int4,_int4) + SELECT width_bucket(5, ARRAY[3]); + ^ +<sql-statement> +SELECT width_bucket(5, '{}'); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT width_bucket(5, '{}'); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + SELECT width_bucket(5, '{}'); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc width_bucket with given argument types: (int4,unknown) + SELECT width_bucket(5, '{}'); + ^ +<sql-statement> +-- error cases +SELECT width_bucket('5'::text, ARRAY[3, 4]::integer[]); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + -- error cases + ^ + -stdin-:<main>:2:8: Error: At function: PgCall + SELECT width_bucket('5'::text, ARRAY[3, 4]::integer[]); + ^ + -stdin-:<main>:2:8: Error: Unable to find an overload for proc width_bucket with given argument types: (text,_int4) + SELECT width_bucket('5'::text, ARRAY[3, 4]::integer[]); + ^ +<sql-statement> +SELECT width_bucket(5, ARRAY[3, 4, NULL]); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT width_bucket(5, ARRAY[3, 4, NULL]); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + SELECT width_bucket(5, ARRAY[3, 4, NULL]); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc width_bucket with given argument types: (int4,_int4) + SELECT width_bucket(5, ARRAY[3, 4, NULL]); + ^ +<sql-statement> +SELECT width_bucket(5, ARRAY[ARRAY[1, 2], ARRAY[3, 4]]); +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT width_bucket(5, ARRAY[ARRAY[1, 2], ARRAY[3, 4]]); + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + SELECT width_bucket(5, ARRAY[ARRAY[1, 2], ARRAY[3, 4]]); + ^ + -stdin-:<main>:1:8: Error: Unable to find an overload for proc width_bucket with given argument types: (int4,_int4) + SELECT width_bucket(5, ARRAY[ARRAY[1, 2], ARRAY[3, 4]]); + ^ +<sql-statement> +-- trim_array +SELECT arr, trim_array(arr, 2) +FROM +(VALUES ('{1,2,3,4,5,6}'::bigint[]), + ('{1,2}'), + ('[10:16]={1,2,3,4,5,6,7}'), + ('[-15:-10]={1,2,3,4,5,6}'), + ('{{1,10},{2,20},{3,30},{4,40}}')) v(arr); +</sql-statement> +<sql-statement> +SELECT trim_array(ARRAY[1, 2, 3], -1); -- fail +</sql-statement> +-stdin-:<main>: Fatal: Execution + + -stdin-:<main>:1:1: Fatal: Execution of node: Result + SELECT trim_array(ARRAY[1, 2, 3], -1); -- fail + ^ + -stdin-:<main>:1:1: Fatal: ERROR: number of elements to trim must be between 0 and 3 + + SELECT trim_array(ARRAY[1, 2, 3], -1); -- fail + ^ +<sql-statement> +SELECT trim_array(ARRAY[1, 2, 3], 10); -- fail +</sql-statement> +-stdin-:<main>: Fatal: Execution + + -stdin-:<main>:1:1: Fatal: Execution of node: Result + SELECT trim_array(ARRAY[1, 2, 3], 10); -- fail + ^ + -stdin-:<main>:1:1: Fatal: ERROR: number of elements to trim must be between 0 and 3 + + SELECT trim_array(ARRAY[1, 2, 3], 10); -- fail + ^ +<sql-statement> +SELECT trim_array(ARRAY[]::int[], 1); -- fail +</sql-statement> +-stdin-:<main>: Error: Type annotation + + -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem + SELECT trim_array(ARRAY[]::int[], 1); -- fail + ^ + -stdin-:<main>:1:8: Error: At function: PgCall + SELECT trim_array(ARRAY[]::int[], 1); -- fail + ^ + -stdin-:<main>:1:28: Error: At function: PgCast + SELECT trim_array(ARRAY[]::int[], 1); -- fail + ^ + -stdin-:<main>:1:19: Error: At function: PgArray + SELECT trim_array(ARRAY[]::int[], 1); -- fail + ^ + -stdin-:<main>:1:19: Error: Expected at least 1 argument(s), but got 0 + SELECT trim_array(ARRAY[]::int[], 1); -- fail + ^ |